⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
String
/
View File Name :
new-c.ri
U:RDoc::AnyMethod[iI"new:ETI"String::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns a new \String that is a copy of +string+.;To:RDoc::Markup::BlankLine o; ; [I"WWith no arguments, returns the empty string with the Encoding
ASCII-8BIT
:;To:RDoc::Markup::Verbatim; [I"s = String.new ;TI"s # => "" ;TI",s.encoding # => #
;T:@format0o; ; [I"KWith the single \String argument +string+, returns a copy of +string+ ;TI"(with the same encoding as +string+:;To;; [I".s = String.new("Que veut dire \u{e7}a?") ;TI"%s # => "Que veut dire \u{e7}a?" ;TI"'s.encoding # => #
;T; 0o; ; [I"CLiteral strings like
""
or here-documents always use ;TI"^{script encoding}[Encoding.html#class-Encoding-label-Script+encoding], unlike String.new.;T@o; ; [I"6With keyword +encoding+, returns a copy of +str+ ;TI"!with the specified encoding:;To;; [ I"'s = String.new(encoding: 'ASCII') ;TI"*s.encoding # => #
;TI".s = String.new('foo', encoding: 'ASCII') ;TI"*s.encoding # => #
;T; 0o; ; [I"$Note that these are equivalent:;To;; [I"/s0 = String.new('foo', encoding: 'ASCII') ;TI"(s1 = 'foo'.force_encoding('ASCII') ;TI"*s0.encoding == s1.encoding # => true ;T; 0o; ; [I"7With keyword +capacity+, returns a copy of +str+; ;TI"Cthe given +capacity+ may set the size of the internal buffer, ;TI""which may affect performance:;To;; [I"%String.new(capacity: 1) # => "" ;TI"(String.new(capacity: 4096) # => "" ;T; 0o; ; [I"QThe +string+, +encoding+, and +capacity+ arguments may all be used together:;To;; [I"9String.new('hello', encoding: 'UTF-8', capacity: 25);T; 0: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"–String.new(string = '') -> new_string String.new(string = '', encoding: encoding) -> new_string String.new(string = '', capacity: size) -> new_string ;T0[ I"(p1 = v1, p2 = {});T@EFI"String;TcRDoc::NormalClass00