PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
String
U:RDoc::AnyMethod[iI"rindex:ETI"String#rindex;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"RReturns the Integer index of the _last_ occurrence of the given +substring+, ;TI"or +nil+ if none found:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"'foo'.rindex('f') # => 0 ;TI"'foo'.rindex('o') # => 2 ;TI"'foo'.rindex('oo') # => 1 ;TI""'foo'.rindex('ooo') # => nil ;T:@format0o; ; [I"RReturns the Integer index of the _last_ match for the given Regexp +regexp+, ;TI"or +nil+ if none found:;T@o;; [ I"'foo'.rindex(/f/) # => 0 ;TI"'foo'.rindex(/o/) # => 2 ;TI"'foo'.rindex(/oo/) # => 1 ;TI""'foo'.rindex(/ooo/) # => nil ;T; 0o; ; [I"HThe _last_ match means starting at the possible last position, not ;TI"!the last of longest matches.;T@o;; [I"'foo'.rindex(/o+/) # => 2 ;TI"$~ #=> #<MatchData "o"> ;T; 0o; ; [I"CTo get the last longest match, needs to combine with negative ;TI"lookbehind.;T@o;; [I"%'foo'.rindex(/(?<!o)o+/) # => 1 ;TI"$~ #=> #<MatchData "oo"> ;T; 0o; ; [I"/Or String#index with negative lookforward.;T@o;; [I"%'foo'.index(/o+(?!.*o)/) # => 1 ;TI"$~ #=> #<MatchData "oo"> ;T; 0o; ; [I"jInteger argument +offset+, if given and non-negative, specifies the maximum starting position in the ;TI" string to _end_ the search:;T@o;; [ I"#'foo'.rindex('o', 0) # => nil ;TI"!'foo'.rindex('o', 1) # => 1 ;TI"!'foo'.rindex('o', 2) # => 2 ;TI"!'foo'.rindex('o', 3) # => 2 ;T; 0o; ; [I"MIf +offset+ is a negative Integer, the maximum starting position in the ;TI"Ostring to _end_ the search is the sum of the string's length and +offset+:;T@o;; [ I""'foo'.rindex('o', -1) # => 2 ;TI""'foo'.rindex('o', -2) # => 1 ;TI"$'foo'.rindex('o', -3) # => nil ;TI"$'foo'.rindex('o', -4) # => nil ;T; 0o; ; [I"Related: String#index.;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"vrindex(substring, offset = self.length) -> integer or nil rindex(regexp, offset = self.length) -> integer or nil ;T0[ I"(p1, p2 = v2);T@NFI"String;TcRDoc::NormalClass00
[+]
..
[-] hex-i.ri
[edit]
[-] start_with%3f-i.ri
[edit]
[-] chr-i.ri
[edit]
[-] each_byte-i.ri
[edit]
[-] to_f-i.ri
[edit]
[-] setbyte-i.ri
[edit]
[-] crypt-i.ri
[edit]
[-] include%3f-i.ri
[edit]
[-] oct-i.ri
[edit]
[-] bytesplice-i.ri
[edit]
[-] tr-i.ri
[edit]
[-] valid_encoding%3f-i.ri
[edit]
[-] b-i.ri
[edit]
[-] swapcase%21-i.ri
[edit]
[-] chop-i.ri
[edit]
[-] upto-i.ri
[edit]
[-] delete%21-i.ri
[edit]
[-] count-i.ri
[edit]
[-] size-i.ri
[edit]
[-] %3d%7e-i.ri
[edit]
[-] tr_s-i.ri
[edit]
[-] delete_prefix-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[-] force_encoding-i.ri
[edit]
[-] %3c%3c-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] delete-i.ri
[edit]
[-] bytesize-i.ri
[edit]
[-] sub%21-i.ri
[edit]
[-] %2a-i.ri
[edit]
[-] shellescape-i.ri
[edit]
[-] center-i.ri
[edit]
[-] rstrip%21-i.ri
[edit]
[-] initialize_copy-i.ri
[edit]
[-] succ%21-i.ri
[edit]
[-] lstrip%21-i.ri
[edit]
[-] codepoints-i.ri
[edit]
[-] swapcase-i.ri
[edit]
[-] chomp%21-i.ri
[edit]
[-] gsub%21-i.ri
[edit]
[-] %3c%3d%3e-i.ri
[edit]
[-] %5b%5d%3d-i.ri
[edit]
[-] prepend-i.ri
[edit]
[-] delete_prefix%21-i.ri
[edit]
[-] encoding-i.ri
[edit]
[-] to_str-i.ri
[edit]
[-] scrub%21-i.ri
[edit]
[-] byteindex-i.ri
[edit]
[-] to_r-i.ri
[edit]
[-] encode-i.ri
[edit]
[-] each_line-i.ri
[edit]
[-] unpack1-i.ri
[edit]
[-] byterindex-i.ri
[edit]
[-] rstrip-i.ri
[edit]
[-] rpartition-i.ri
[edit]
[-] new-c.ri
[edit]
[-] match-i.ri
[edit]
[-] upcase-i.ri
[edit]
[-] reverse%21-i.ri
[edit]
[-] ljust-i.ri
[edit]
[-] reverse-i.ri
[edit]
[-] split-i.ri
[edit]
[-] casecmp-i.ri
[edit]
[-] sum-i.ri
[edit]
[-] chop%21-i.ri
[edit]
[-] append_as_bytes-i.ri
[edit]
[-] casecmp%3f-i.ri
[edit]
[-] cdesc-String.ri
[edit]
[-] squeeze%21-i.ri
[edit]
[-] capitalize%21-i.ri
[edit]
[-] unicode_normalize-i.ri
[edit]
[-] %2d%40-i.ri
[edit]
[-] strip%21-i.ri
[edit]
[-] unpack-i.ri
[edit]
[-] scrub-i.ri
[edit]
[-] next%21-i.ri
[edit]
[-] delete_suffix-i.ri
[edit]
[-] tr%21-i.ri
[edit]
[-] dedup-i.ri
[edit]
[-] hash-i.ri
[edit]
[-] strip-i.ri
[edit]
[-] match%3f-i.ri
[edit]
[-] bytes-i.ri
[edit]
[-] delete_suffix%21-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] eql%3f-i.ri
[edit]
[-] ascii_only%3f-i.ri
[edit]
[-] slice-i.ri
[edit]
[-] empty%3f-i.ri
[edit]
[-] downcase%21-i.ri
[edit]
[-] slice%21-i.ri
[edit]
[-] gsub-i.ri
[edit]
[-] grapheme_clusters-i.ri
[edit]
[-] getbyte-i.ri
[edit]
[-] each_char-i.ri
[edit]
[-] rjust-i.ri
[edit]
[-] insert-i.ri
[edit]
[-] lstrip-i.ri
[edit]
[-] to_c-i.ri
[edit]
[-] to_sym-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] shellsplit-i.ri
[edit]
[-] squeeze-i.ri
[edit]
[-] to_i-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] dump-i.ri
[edit]
[-] undump-i.ri
[edit]
[-] chomp-i.ri
[edit]
[-] upcase%21-i.ri
[edit]
[-] each_codepoint-i.ri
[edit]
[-] %2b-i.ri
[edit]
[-] end_with%3f-i.ri
[edit]
[-] partition-i.ri
[edit]
[-] downcase-i.ri
[edit]
[-] chars-i.ri
[edit]
[-] scan-i.ri
[edit]
[-] %2b%40-i.ri
[edit]
[-] succ-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] lines-i.ri
[edit]
[-] index-i.ri
[edit]
[-] intern-i.ri
[edit]
[-] rindex-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] encode%21-i.ri
[edit]
[-] replace-i.ri
[edit]
[-] ord-i.ri
[edit]
[-] clear-i.ri
[edit]
[-] unicode_normalize%21-i.ri
[edit]
[-] next-i.ri
[edit]
[-] byteslice-i.ri
[edit]
[-] each_grapheme_cluster-i.ri
[edit]
[-] length-i.ri
[edit]
[-] unicode_normalized%3f-i.ri
[edit]
[-] concat-i.ri
[edit]
[-] sub-i.ri
[edit]
[-] tr_s%21-i.ri
[edit]
[-] capitalize-i.ri
[edit]