📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-21 19:53:39
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
String
📍 /opt/alt/ruby31/share/ri/system/String
🔄 Refresh
✏️
Editing: cdesc-String.ri
Read Only
U:RDoc::NormalClass[iI"String:ET@I"Object;To:RDoc::Markup::Document:@parts[ o;;[ : @fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"ext/nkf/lib/kconv.rb;T; 0o;;[ ; I"lib/shellwords.rb;T; 0o;;[ ; I"pack.rb;T; 0o;;[�o:RDoc::Markup::Paragraph;[I":A \String object has an arbitrary sequence of bytes, ;TI"1typically representing text or binary data. ;TI"FA \String object may be created using String::new or as literals.;To:RDoc::Markup::BlankLine o;;[I"JString objects differ from Symbol objects in that Symbol objects are ;TI"Adesigned to be used as identifiers, instead of text or data.;T@o;;[I"5You can create a \String object explicitly with:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I"MA {string literal}[doc/syntax/literals_rdoc.html#label-String+Literals].;To;;0;[o;;[I"UA {heredoc literal}[doc/syntax/literals_rdoc.html#label-Here+Document+Literals].;T@o;;[I"5You can convert certain objects to Strings with:;T@o; ;;;[o;;0;[o;;[I"3\Method {String}[Kernel.html#method-i-String].;T@o;;[ I")Some \String methods modify +self+. ;TI"ITypically, a method whose name ends with <tt>!</tt> modifies +self+ ;TI"and returns +self+; ;TI"=often a similarly named method (without the <tt>!</tt>) ;TI"returns a new string.;T@o;;[I"JIn general, if there exist both bang and non-bang version of method, ;TI"3the bang! mutates and the non-bang! does not. ;TI"NHowever, a method without a bang can also mutate, such as String#replace.;T@S:RDoc::Markup::Heading: leveli: textI"Substitution Methods;T@o;;[I")These methods perform substitutions:;T@o; ;;;[ o;;0;[o;;[I"BString#sub: One substitution (or none); returns a new string.;To;;0;[o;;[I"=String#sub!: One substitution (or none); returns +self+.;To;;0;[o;;[I"CString#gsub: Zero or more substitutions; returns a new string.;To;;0;[o;;[I">String#gsub!: Zero or more substitutions; returns +self+.;T@o;;[I"!Each of these methods takes:;T@o; ;;;[o;;0;[o;;[I"5A first argument, +pattern+ (string or regexp), ;TI"4that specifies the substring(s) to be replaced.;T@o;;0;[o;;[I"Either of these:;T@o; ;;;[o;;0;[o;;[I"8A second argument, +replacement+ (string or hash), ;TI"*that determines the replacing string.;To;;0;[o;;[I"6A block that will determine the replacing string.;T@o;;[I"QThe examples in this section mostly use methods String#sub and String#gsub; ;TI"Gthe principles illustrated apply to all four substitution methods.;T@o;;[I"<b>Argument +pattern+</b>;T@o;;[I"9Argument +pattern+ is commonly a regular expression:;T@o:RDoc::Markup::Verbatim;[I"s = 'hello' ;TI")s.sub(/[aeiou]/, '*') # => "h*llo" ;TI")s.gsub(/[aeiou]/, '*') # => "h*ll*" ;TI"'s.gsub(/[aeiou]/, '') # => "hll" ;TI"(s.sub(/ell/, 'al') # => "halo" ;TI")s.gsub(/xyzzy/, '*') # => "hello" ;TI".'THX1138'.gsub(/\d+/, '00') # => "THX00" ;T:@format0o;;[I"@When +pattern+ is a string, all its characters are treated ;TI"?as ordinary characters (not as regexp special characters):;T@o;;[I"0'THX1138'.gsub('\d+', '00') # => "THX1138" ;T;0o;;[I"!<b>\String +replacement+</b>;T@o;;[I">If +replacement+ is a string, that string will determine ;TI"Ithe replacing string that is to be substituted for the matched text.;T@o;;[I"MEach of the examples above uses a simple string as the replacing string.;T@o;;[I"Q\String +replacement+ may contain back-references to the pattern's captures:;T@o; ;;;[o;;0;[o;;[I"D<tt>\n</tt> (_n_ a non-negative integer) refers to <tt>$n</tt>.;To;;0;[o;;[I":<tt>\k<name></tt> refers to the named capture +name+.;T@o;;[I"*See rdoc-ref:regexp.rdoc for details.;T@o;;[ I"HNote that within the string +replacement+, a character combination ;TI"Asuch as <tt>$&</tt> is treated as ordinary text, and not as ;TI"a special match variable. ;TI"HHowever, you may refer to some special match variables using these ;TI"combinations:;T@o; ;;;[ o;;0;[o;;[I"<<tt>\&</tt> and <tt>\0</tt> correspond to <tt>$&</tt>, ;TI".which contains the complete matched text.;To;;0;[o;;[I"-<tt>\'</tt> corresponds to <tt>$'</tt>, ;TI"'which contains string after match.;To;;0;[o;;[I"-<tt>\`</tt> corresponds to <tt>$`</tt>, ;TI"(which contains string before match.;To;;0;[o;;[I"-<tt>\+</tt> corresponds to <tt>$+</tt>, ;TI"'which contains last capture group.;T@o;;[I"*See rdoc-ref:regexp.rdoc for details.;T@o;;[I"SNote that <tt>\\\\</tt> is interpreted as an escape, i.e., a single backslash.;T@o;;[I";Note also that a string literal consumes backslashes. ;TI"rSee {String Literals}[doc/syntax/literals_rdoc.html#label-String+Literals] for details about string literals.;T@o;;[ I"HA back-reference is typically preceded by an additional backslash. ;TI"GFor example, if you want to write a back-reference <tt>\&</tt> in ;TI"J+replacement+ with a double-quoted string literal, you need to write ;TI"<tt>"..\\\\&.."</tt>.;T@o;;[ I"EIf you want to write a non-back-reference string <tt>\&</tt> in ;TI"F+replacement+, you need first to escape the backslash to prevent ;TI"Hthis method from interpreting it as a back-reference, and then you ;TI"Kneed to escape the backslashes again to prevent a string literal from ;TI".consuming them: <tt>"..\\\\\\\\&.."</tt>.;T@o;;[I"FYou may want to use the block form to avoid a lot of backslashes.;T@o;;[I"<b>\Hash +replacement+</b>;T@o;;[I"QIf argument +replacement+ is a hash, and +pattern+ matches one of its keys, ;TI"4the replacing string is the value for that key:;T@o;;[I"*h = {'foo' => 'bar', 'baz' => 'bat'} ;TI"&'food'.sub('foo', h) # => "bard" ;T;0o;;[I"+Note that a symbol key does not match:;T@o;;[I""h = {foo: 'bar', baz: 'bat'} ;TI"#'food'.sub('foo', h) # => "d" ;T;0o;;[I"<b>Block</b>;T@o;;[I"IIn the block form, the current match string is passed to the block; ;TI";the block's return value becomes the replacing string:;T@o;;[I" s = '@' ;TI"6'1234'.gsub(/\d/) {|match| s.succ! } # => "ABCD" ;T;0o;;[I"LSpecial match variables such as <tt>$1</tt>, <tt>$2</tt>, <tt>$`</tt>, ;TI"8<tt>$&</tt>, and <tt>$'</tt> are set appropriately.;T@S;;i;I"What's Here;T@o;;[I"-First, what's elsewhere. \Class \String:;T@o; ;;;[o;;0;[o;;[I"PInherits from {class Object}[Object.html#class-Object-label-What-27s+Here].;To;;0;[o;;[I"YIncludes {module Comparable}[Comparable.html#module-Comparable-label-What-27s+Here].;T@o;;[I">Here, class \String provides methods that are useful for:;T@o; ;;;[ o;;0;[o;;[I"K{Creating a String}[#class-String-label-Methods+for+Creating+a+String];To;;0;[o;;[I"Z{Frozen/Unfrozen Strings}[#class-String-label-Methods+for+a+Frozen-2FUnfrozen+String];To;;0;[o;;[I"9{Querying}[#class-String-label-Methods+for+Querying];To;;0;[o;;[I";{Comparing}[#class-String-label-Methods+for+Comparing];To;;0;[o;;[I"M{Modifying a String}[#class-String-label-Methods+for+Modifying+a+String];To;;0;[o;;[I"Y{Converting to New String}[#class-String-label-Methods+for+Converting+to+New+String];To;;0;[o;;[I"\{Converting to Non-String}[#class-String-label-Methods+for+Converting+to+Non--5CString];To;;0;[o;;[I";{Iterating}[#class-String-label-Methods+for+Iterating];T@S;;i;I"#Methods for Creating a \String;T@o; ;;;[o;;0;[o; ;: NOTE;[o;;[I" ::new;T;[o;;[I"Returns a new string.;To;;0;[o; ;;;[o;;[I"::try_convert;T;[o;;[I"6Returns a new string created from a given object.;T@S;;i;I")Methods for a Frozen/Unfrozen String;T@o; ;;;[o;;0;[o; ;;;[o;;[I" {#+string}[#method-i-2B-40];T;[o;;[I"*Returns a string that is not frozen: ;TI"1+self+, if not frozen; +self.dup+ otherwise.;To;;0;[o; ;;;[o;;[I" {#-string}[#method-i-2D-40];T;[o;;[I"&Returns a string that is frozen: ;TI"8+self+, if already frozen; +self.freeze+ otherwise.;To;;0;[o; ;;;[o;;[I"#freeze;T;[o;;[I";Freezes +self+, if not already frozen; returns +self+.;T@S;;i;I"Methods for Querying;T@o;;[I" _Counts_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#length, #size;T;[o;;[I"1Returns the count of characters (not bytes).;To;;0;[o; ;;;[o;;[I"#empty?;T;[o;;[I"@Returns +true+ if +self.length+ is zero; +false+ otherwise.;To;;0;[o; ;;;[o;;[I"#bytesize;T;[o;;[I" Returns the count of bytes.;To;;0;[o; ;;;[o;;[I"#count;T;[o;;[I"<Returns the count of substrings matching given strings.;T@o;;[I"_Substrings_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"{#=~}[#method-i-3D~];T;[o;;[I"[Returns the index of the first substring that matches a given Regexp or other object; ;TI"(returns +nil+ if no match is found.;To;;0;[o; ;;;[o;;[I"#index;T;[o;;[I"GReturns the index of the _first_ occurrence of a given substring; ;TI"!returns +nil+ if none found.;To;;0;[o; ;;;[o;;[I"#rindex;T;[o;;[I"FReturns the index of the _last_ occurrence of a given substring; ;TI"!returns +nil+ if none found.;To;;0;[o; ;;;[o;;[I"#include?;T;[o;;[I"PReturns +true+ if the string contains a given substring; +false+ otherwise.;To;;0;[o; ;;;[o;;[I"#match;T;[o;;[I"VReturns a MatchData object if the string matches a given Regexp; +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#match?;T;[o;;[I"LReturns +true+ if the string matches a given Regexp; +false+ otherwise.;To;;0;[o; ;;;[o;;[I"#start_with?;T;[o;;[I"JReturns +true+ if the string begins with any of the given substrings.;To;;0;[o; ;;;[o;;[I"#end_with?;T;[o;;[I"HReturns +true+ if the string ends with any of the given substrings.;T@o;;[I"_Encodings_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#encoding;T;[o;;[I"LReturns the Encoding object that represents the encoding of the string.;To;;0;[o; ;;;[o;;[I"#unicode_normalized?;T;[o;;[I"SReturns +true+ if the string is in Unicode normalized form; +false+ otherwise.;To;;0;[o; ;;;[o;;[I"#valid_encoding?;T;[o;;[I"JReturns +true+ if the string contains only characters that are valid ;TI"for its encoding.;To;;0;[o; ;;;[o;;[I"#ascii_only?;T;[o;;[I"OReturns +true+ if the string has only ASCII characters; +false+ otherwise.;T@o;;[I"_Other_;T@o; ;;;[o;;0;[o; ;;;[o;;[I" #sum;T;[o;;[I"CReturns a basic checksum for the string: the sum of each byte.;To;;0;[o; ;;;[o;;[I" #hash;T;[o;;[I"#Returns the integer hash code.;T@S;;i;I"Methods for Comparing;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"!{#==, #===}[#method-i-3D-3D];T;[o;;[I"KReturns +true+ if a given other string has the same content as +self+.;To;;0;[o; ;;;[o;;[I" #eql?;T;[o;;[I"IReturns +true+ if the content is the same as the given other string.;To;;0;[o; ;;;[o;;[I"{#<=>}[#method-i-3C-3D-3E];T;[o;;[I"bReturns -1, 0, or 1 as a given other string is smaller than, equal to, or larger than +self+.;To;;0;[o; ;;;[o;;[I" #casecmp;T;[o;;[I"3Ignoring case, returns -1, 0, or 1 as a given ;TI"Cother string is smaller than, equal to, or larger than +self+.;To;;0;[o; ;;;[o;;[I"#casecmp?;T;[o;;[I"YReturns +true+ if the string is equal to a given string after Unicode case folding; ;TI"+false+ otherwise.;T@S;;i;I"$Methods for Modifying a \String;T@o;;[I"+Each of these methods modifies +self+.;T@o;;[I"_Insertion_;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#insert;T;[o;;[I"CReturns +self+ with a given string inserted at a given offset.;To;;0;[o; ;;;[o;;[I"#<<;T;[o;;[I"@Returns +self+ concatenated with a given string or integer.;T@o;;[I"_Substitution_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I" #sub!;T;[o;;[I"`Replaces the first substring that matches a given pattern with a given replacement string; ;TI"4returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#gsub!;T;[o;;[I"[Replaces each substring that matches a given pattern with a given replacement string; ;TI"4returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#succ!, #next!;T;[o;;[I"9Returns +self+ modified to become its own successor.;To;;0;[o; ;;;[o;;[I" #replace;T;[o;;[I"GReturns +self+ with its entire content replaced by a given string.;To;;0;[o; ;;;[o;;[I"#reverse!;T;[o;;[I"9Returns +self+ with its characters in reverse order.;To;;0;[o; ;;;[o;;[I" #setbyte;T;[o;;[I"TSets the byte at a given integer offset to a given value; returns the argument.;To;;0;[o; ;;;[o;;[I" #tr!;T;[o;;[I"TReplaces specified characters in +self+ with specified replacement characters; ;TI"4returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#tr_s!;T;[o;;[I"TReplaces specified characters in +self+ with specified replacement characters, ;TI"Aremoving duplicates from the substrings that were modified; ;TI"4returns +self+ if any changes, +nil+ otherwise.;T@o;;[I" _Casing_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#capitalize!;T;[o;;[I"=Upcases the initial character and downcases all others; ;TI"4returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#downcase!;T;[o;;[I"NDowncases all characters; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I" #upcase!;T;[o;;[I"LUpcases all characters; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#swapcase!;T;[o;;[I"JUpcases each downcase character and downcases each upcase character; ;TI"4returns +self+ if any changes, +nil+ otherwise.;T@o;;[I"_Encoding_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I" #encode!;T;[o;;[I"XReturns +self+ with all characters transcoded from one given encoding into another.;To;;0;[o; ;;;[o;;[I"#unicode_normalize!;T;[o;;[I"/Unicode-normalizes +self+; returns +self+.;To;;0;[o; ;;;[o;;[I"#scrub!;T;[o;;[I"GReplaces each invalid byte with a given character; returns +self+.;To;;0;[o; ;;;[o;;[I"#force_encoding;T;[o;;[I">Changes the encoding to a given encoding; returns +self+.;T@o;;[I"_Deletion_;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#clear;T;[o;;[I"BRemoves all content, so that +self+ is empty; returns +self+.;To;;0;[o; ;;;[o;;[I"#slice!, #[]=;T;[o;;[I"`Removes a substring determined by a given index, start/length, range, regexp, or substring.;To;;0;[o; ;;;[o;;[I"#squeeze!;T;[o;;[I"=Removes contiguous duplicate characters; returns +self+.;To;;0;[o; ;;;[o;;[I" #delete!;T;[o;;[I"QRemoves characters as determined by the intersection of substring arguments.;To;;0;[o; ;;;[o;;[I" #lstrip!;T;[o;;[I"PRemoves leading whitespace; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I" #rstrip!;T;[o;;[I"QRemoves trailing whitespace; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#strip!;T;[o;;[I"]Removes leading and trailing whitespace; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#chomp!;T;[o;;[I"aRemoves trailing record separator, if found; returns +self+ if any changes, +nil+ otherwise.;To;;0;[o; ;;;[o;;[I"#chop!;T;[o;;[I"QRemoves trailing whitespace if found, otherwise removes the last character; ;TI"4returns +self+ if any changes, +nil+ otherwise.;T@S;;i;I"*Methods for Converting to New \String;T@o;;[I"BEach of these methods returns a new \String based on +self+, ;TI"*often just a modified copy of +self+.;T@o;;[I"_Extension_;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#*;T;[o;;[I"<Returns the concatenation of multiple copies of +self+,;To;;0;[o; ;;;[o;;[I"#+;T;[o;;[I"BReturns the concatenation of +self+ and a given other string.;To;;0;[o; ;;;[o;;[I"#center;T;[o;;[I"=Returns a copy of +self+ centered between pad substring.;To;;0;[o; ;;;[o;;[I"#concat;T;[o;;[I"BReturns the concatenation of +self+ with given other strings.;To;;0;[o; ;;;[o;;[I" #prepend;T;[o;;[I"CReturns the concatenation of a given other string with +self+.;To;;0;[o; ;;;[o;;[I"#ljust;T;[o;;[I"XReturns a copy of +self+ of a given length, right-padded with a given other string.;To;;0;[o; ;;;[o;;[I"#rjust;T;[o;;[I"WReturns a copy of +self+ of a given length, left-padded with a given other string.;T@o;;[I"_Encoding_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#b;T;[o;;[I"7Returns a copy of +self+ with ASCII-8BIT encoding.;To;;0;[o; ;;;[o;;[I"#scrub;T;[o;;[I"UReturns a copy of +self+ with each invalid byte replaced with a given character.;To;;0;[o; ;;;[o;;[I"#unicode_normalize;T;[o;;[I"EReturns a copy of +self+ with each character Unicode-normalized.;To;;0;[o; ;;;[o;;[I"#encode;T;[o;;[I"bReturns a copy of +self+ with all characters transcoded from one given encoding into another.;T@o;;[I"_Substitution_;T@o; ;;;[o;;0;[o; ;;;[o;;[I" #dump;T;[o;;[I"XReturns a copy of +self with all non-printing characters replaced by \xHH notation ;TI"(and all special characters escaped.;To;;0;[o; ;;;[o;;[I"#undump;T;[o;;[I"aReturns a copy of +self with all <tt>\xNN</tt> notation replace by <tt>\uNNNN</tt> notation ;TI"*and all escaped characters unescaped.;To;;0;[o; ;;;[o;;[I" #sub;T;[o;;[I"PReturns a copy of +self+ with the first substring matching a given pattern ;TI"/replaced with a given replacement string;.;To;;0;[o; ;;;[o;;[I" #gsub;T;[o;;[I"OReturns a copy of +self+ with each substring that matches a given pattern ;TI".replaced with a given replacement string.;To;;0;[o; ;;;[o;;[I"#succ, #next;T;[o;;[I"8Returns the string that is the successor to +self+.;To;;0;[o; ;;;[o;;[I" #reverse;T;[o;;[I"CReturns a copy of +self+ with its characters in reverse order.;To;;0;[o; ;;;[o;;[I"#tr;T;[o;;[I"gReturns a copy of +self+ with specified characters replaced with specified replacement characters.;To;;0;[o; ;;;[o;;[I" #tr_s;T;[o;;[I"hReturns a copy of +self+ with specified characters replaced with specified replacement characters, ;TI"@removing duplicates from the substrings that were modified.;To;;0;[o; ;;;[o;;[I"#%;T;[o;;[I"LReturns the string resulting from formatting a given object into +self+;T@o;;[I" _Casing_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#capitalize;T;[o;;[I"?Returns a copy of +self+ with the first character upcased ;TI"(and all other characters downcased.;To;;0;[o; ;;;[o;;[I"#downcase;T;[o;;[I"<Returns a copy of +self+ with all characters downcased.;To;;0;[o; ;;;[o;;[I"#upcase;T;[o;;[I":Returns a copy of +self+ with all characters upcased.;To;;0;[o; ;;;[o;;[I"#swapcase;T;[o;;[I"CReturns a copy of +self+ with all upcase characters downcased ;TI")and all downcase characters upcased.;T@o;;[I"_Deletion_;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#delete;T;[o;;[I"5Returns a copy of +self+ with characters removed;To;;0;[o; ;;;[o;;[I"#delete_prefix;T;[o;;[I":Returns a copy of +self+ with a given prefix removed.;To;;0;[o; ;;;[o;;[I"#delete_suffix;T;[o;;[I":Returns a copy of +self+ with a given suffix removed.;To;;0;[o; ;;;[o;;[I"#lstrip;T;[o;;[I">Returns a copy of +self+ with leading whitespace removed.;To;;0;[o; ;;;[o;;[I"#rstrip;T;[o;;[I"?Returns a copy of +self+ with trailing whitespace removed.;To;;0;[o; ;;;[o;;[I"#strip;T;[o;;[I"KReturns a copy of +self+ with leading and trailing whitespace removed.;To;;0;[o; ;;;[o;;[I"#chomp;T;[o;;[I"QReturns a copy of +self+ with a trailing record separator removed, if found.;To;;0;[o; ;;;[o;;[I" #chop;T;[o;;[I"UReturns a copy of +self+ with trailing whitespace or the last character removed.;To;;0;[o; ;;;[o;;[I" #squeeze;T;[o;;[I"KReturns a copy of +self+ with contiguous duplicate characters removed.;To;;0;[o; ;;;[o;;[I"#[], #slice;T;[o;;[I"XReturns a substring determined by a given index, start/length, or range, or string.;To;;0;[o; ;;;[o;;[I"#byteslice;T;[o;;[I"MReturns a substring determined by a given index, start/length, or range.;To;;0;[o; ;;;[o;;[I" #chr;T;[o;;[I"!Returns the first character.;T@o;;[I"_Duplication_;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#to_s, $to_str;T;[o;;[I"OIf +self+ is a subclass of \String, returns +self+ copied into a \String; ;TI"otherwise, returns +self+.;T@S;;i;I"*Methods for Converting to Non-\String;T@o;;[I"LEach of these methods converts the contents of +self+ to a non-\String.;T@o;;[I"-<em>Characters, Bytes, and Clusters</em>;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#bytes;T;[o;;[I"-Returns an array of the bytes in +self+.;To;;0;[o; ;;;[o;;[I"#chars;T;[o;;[I"2Returns an array of the characters in +self+.;To;;0;[o; ;;;[o;;[I"#codepoints;T;[o;;[I"8Returns an array of the integer ordinals in +self+.;To;;0;[o; ;;;[o;;[I" #getbyte;T;[o;;[I"<Returns an integer byte as determined by a given index.;To;;0;[o; ;;;[o;;[I"#grapheme_clusters;T;[o;;[I"9Returns an array of the grapheme clusters in +self+.;T@o;;[I"_Splitting_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I"#lines;T;[o;;[I"XReturns an array of the lines in +self+, as determined by a given record separator.;To;;0;[o; ;;;[o;;[I"#partition;T;[o;;[I"NReturns a 3-element array determined by the first substring that matches ;TI"!a given substring or regexp,;To;;0;[o; ;;;[o;;[I"#rpartition;T;[o;;[I"MReturns a 3-element array determined by the last substring that matches ;TI"!a given substring or regexp,;To;;0;[o; ;;;[o;;[I"#split;T;[o;;[I"[Returns an array of substrings determined by a given delimiter -- regexp or string -- ;TI"@or, if a block given, passes those substrings to the block.;T@o;;[I"_Matching_;T@o; ;;;[o;;0;[o; ;;;[o;;[I" #scan;T;[o;;[I"KReturns an array of substrings matching a given regexp or string, or, ;TI"Dif a block given, passes each matching substring to the block.;To;;0;[o; ;;;[o;;[I"#unpack;T;[o;;[I"VReturns an array of substrings extracted from +self+ according to a given format.;To;;0;[o; ;;;[o;;[I" #unpack1;T;[o;;[I"SReturns the first substring extracted from +self+ according to a given format.;T@o;;[I"_Numerics_;T@o; ;;;[ o;;0;[o; ;;;[o;;[I" #hex;T;[o;;[I"\Returns the integer value of the leading characters, interpreted as hexadecimal digits.;To;;0;[o; ;;;[o;;[I" #oct;T;[o;;[I"VReturns the integer value of the leading characters, interpreted as octal digits.;To;;0;[o; ;;;[o;;[I" #ord;T;[o;;[I"BReturns the integer ordinal of the first character in +self+.;To;;0;[o; ;;;[o;;[I" #to_i;T;[o;;[I"PReturns the integer value of leading characters, interpreted as an integer.;To;;0;[o; ;;;[o;;[I" #to_f;T;[o;;[I"dReturns the floating-point value of leading characters, interpreted as a floating-point number.;T@o;;[I"!<em>Strings and Symbols</em>;T@o; ;;;[o;;0;[o; ;;;[o;;[I" #inspect;T;[o;;[I"XReturns copy of +self+, enclosed in double-quotes, with special characters escaped.;To;;0;[o; ;;;[o;;[I"#to_sym, #intern;T;[o;;[I"0Returns the symbol corresponding to +self+.;T@S;;i;I"Methods for Iterating;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#each_byte;T;[o;;[I"?Calls the given block with each successive byte in +self+.;To;;0;[o; ;;;[o;;[I"#each_char;T;[o;;[I"DCalls the given block with each successive character in +self+.;To;;0;[o; ;;;[o;;[I"#each_codepoint;T;[o;;[I"LCalls the given block with each successive integer codepoint in +self+.;To;;0;[o; ;;;[o;;[I"#each_grapheme_cluster;T;[o;;[I"KCalls the given block with each successive grapheme cluster in +self+.;To;;0;[o; ;;;[o;;[I"#each_line;T;[o;;[I"@Calls the given block with each successive line in +self+, ;TI"/as determined by a given record separator.;To;;0;[o; ;;;[o;;[I" #upto;T;[o;;[I"XCalls the given block with each string value returned by successive calls to #succ.;T; I" string.c;T; 0; 0; 0[ [ [[I"Comparable;To;;[ ; @�; 0I" string.c;T[[I" class;T[[:public[ [:protected[ [:private[[I"new;T@�[I"try_convert;T@�[I" instance;T[[;[ [;[ [;[�[I"%;T@�[I"*;T@�[I"+;T@�[I"+@;T@�[I"-@;T@�[I"<<;T@�[I"<=>;T@�[I"==;T@�[I"===;T@�[I"=~;T@�[I"[];T@�[I"[]=;T@�[I"ascii_only?;T@�[I"b;T@�[I" bytes;T@�[I" bytesize;T@�[I"byteslice;T@�[I"capitalize;T@�[I"capitalize!;T@�[I"casecmp;T@�[I" casecmp?;T@�[I"center;T@�[I" chars;T@�[I" chomp;T@�[I"chomp!;T@�[I" chop;T@�[I" chop!;T@�[I"chr;T@�[I" clear;T@�[I"codepoints;T@�[I"concat;T@�[I" count;T@�[I" crypt;T@�[I"delete;T@�[I"delete!;T@�[I"delete_prefix;T@�[I"delete_prefix!;T@�[I"delete_suffix;T@�[I"delete_suffix!;T@�[I" downcase;T@�[I"downcase!;T@�[I" dump;T@�[I"each_byte;T@�[I"each_char;T@�[I"each_codepoint;T@�[I"each_grapheme_cluster;T@�[I"each_line;T@�[I"empty?;T@�[I"encode;TI"transcode.c;T[I"encode!;T@w[I" encoding;T@�[I"end_with?;T@�[I" eql?;T@�[I"force_encoding;T@�[I"freeze;T@�[I"getbyte;T@�[I"grapheme_clusters;T@�[I" gsub;T@�[I" gsub!;T@�[I" hash;T@�[I"hex;T@�[I" include?;T@�[I" index;T@�[I"initialize_copy;T@�[I"insert;T@�[I"inspect;T@�[I"intern;T@�[I" iseuc;TI"ext/nkf/lib/kconv.rb;T[I" isjis;T@�[I"issjis;T@�[I"isutf8;T@�[I" kconv;T@�[I"length;T@�[I" lines;T@�[I" ljust;T@�[I"lstrip;T@�[I"lstrip!;T@�[I" match;T@�[I"match?;T@�[I" next;T@�[I" next!;T@�[I"oct;T@�[I"ord;T@�[I"partition;T@�[I"prepend;T@�[I"replace;T@�[I"reverse;T@�[I" reverse!;T@�[I"rindex;T@�[I" rjust;T@�[I"rpartition;T@�[I"rstrip;T@�[I"rstrip!;T@�[I" scan;T@�[I" scrub;T@�[I"scrub!;T@�[I"setbyte;T@�[I"shellescape;TI"lib/shellwords.rb;T[I"shellsplit;T@�[I" size;T@�[I" slice;T@�[I"slice!;T@�[I" split;T@�[I"squeeze;T@�[I" squeeze!;T@�[I"start_with?;T@�[I" strip;T@�[I"strip!;T@�[I"sub;T@�[I" sub!;T@�[I" succ;T@�[I" succ!;T@�[I"sum;T@�[I" swapcase;T@�[I"swapcase!;T@�[I" to_c;TI"complex.c;T[I" to_d;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;T[I" to_f;T@�[I" to_i;T@�[I" to_r;TI"rational.c;T[I" to_s;T@�[I"to_str;T@�[I"to_sym;T@�[I" toeuc;T@�[I" tojis;T@�[I" tolocale;T@�[I"tosjis;T@�[I"toutf16;T@�[I"toutf32;T@�[I"toutf8;T@�[I"tr;T@�[I"tr!;T@�[I" tr_s;T@�[I" tr_s!;T@�[I"undump;T@�[I"unicode_normalize;T@�[I"unicode_normalize!;T@�[I"unicode_normalized?;T@�[I"unpack;TI"pack.rb;T[I"unpack1;T@1[I"upcase;T@�[I"upcase!;T@�[I" upto;T@�[I"valid_encoding?;T@�[ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[I"complex.c;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;TI"ext/nkf/lib/kconv.rb;TI"lib/csv/core_ext/string.rb;TI"lib/mkmf.rb;TI"lib/pp.rb;TI"lib/shellwords.rb;TI"pack.rb;TI"rational.c;TI" string.c;TI"transcode.c;T@�cRDoc::TopLevel
💾 Save Changes
❌ Cancel