U:RDoc::AnyMethod[iI"[]:ETI"String#[];TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"NElement Reference --- If passed a single +index+, returns a substring of ;TI"Lone character at that index. If passed a +start+ index and a +length+, ;TI"Hreturns a substring containing +length+ characters starting at the ;TI"R+start+ index. If passed a +range+, its beginning and end are interpreted as ;TI"5offsets delimiting the substring to be returned.;To:RDoc::Markup::BlankLineo; ; [ I"OIn these three cases, if an index is negative, it is counted from the end ;TI"Jof the string. For the +start+ and +range+ cases the starting index ;TI"Iis just before a character and an index matching the string's size. ;TI"MAdditionally, an empty string is returned when the starting index for a ;TI"1character range is at the end of the string.;T@o; ; [I"OReturns +nil+ if the initial index falls outside the string or the length ;TI"is negative.;T@o; ; [ I"FIf a +Regexp+ is supplied, the matching portion of the string is ;TI"Nreturned. If a +capture+ follows the regular expression, which may be a ;TI"Pcapture group index or name, follows the regular expression that component ;TI"*of the MatchData is returned instead.;T@o; ; [I"HIf a +match_str+ is given, that string is returned if it occurs in ;TI"the string.;T@o; ; [I"PReturns +nil+ if the regular expression does not match or the match string ;TI"cannot be found.;T@o:RDoc::Markup::Verbatim; [I"a = "hello there" ;TI" ;TI"$a[1] #=> "e" ;TI"&a[2, 3] #=> "llo" ;TI"%a[2..3] #=> "ll" ;TI" ;TI"%a[-3, 2] #=> "er" ;TI"&a[7..-2] #=> "her" ;TI"&a[-4..-2] #=> "her" ;TI"#a[-2..-4] #=> "" ;TI" ;TI"#a[11, 0] #=> "" ;TI"$a[11] #=> nil ;TI"$a[12, 0] #=> nil ;TI"$a[12..-1] #=> nil ;TI" ;TI"&a[/[aeiou](.)\1/] #=> "ell" ;TI"&a[/[aeiou](.)\1/, 0] #=> "ell" ;TI"$a[/[aeiou](.)\1/, 1] #=> "l" ;TI"$a[/[aeiou](.)\1/, 2] #=> nil ;TI" ;TI"Ga[/(?[aeiou])(?[^aeiou])/, "non_vowel"] #=> "l" ;TI"Ga[/(?[aeiou])(?[^aeiou])/, "vowel"] #=> "e" ;TI" ;TI"%a["lo"] #=> "lo" ;TI"#a["bye"] #=> nil;T: @format0: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I" str[index] -> new_str or nil str[start, length] -> new_str or nil str[range] -> new_str or nil str[regexp] -> new_str or nil str[regexp, capture] -> new_str or nil str[match_str] -> new_str or nil;T0[I" (*args);T@HFI" String;TcRDoc::NormalClassI" scanf;T0