⚝
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 :
%5b%5d-i.ri
U:RDoc::AnyMethod[iI"[]:ETI"String#[];TF:publico:RDoc::Markup::Document:@parts[$o:RDoc::Markup::Paragraph; [I"@Returns the substring of +self+ specified by the arguments.;To:RDoc::Markup::BlankLine o; ; [I"9When the single \Integer argument +index+ is given, ;TI"Ireturns the 1-character substring found in +self+ at offset +index+:;To:RDoc::Markup::Verbatim; [I"'bar'[2] # => "r" ;T:@format0o; ; [I"CCounts backward from the end of +self+ if +index+ is negative:;To;; [I"'foo'[-3] # => "f" ;T; 0o; ; [I".Returns +nil+ if +index+ is out of range:;To;; [I"'foo'[3] # => nil ;TI"'foo'[-4] # => nil ;T; 0o; ; [I"FWhen the two \Integer arguments +start+ and +length+ are given, ;TI"Sreturns the substring of the given +length+ found in +self+ at offset +start+:;To;; [I"'foo'[0, 2] # => "fo" ;TI"'foo'[0, 0] # => "" ;T; 0o; ; [I"CCounts backward from the end of +self+ if +start+ is negative:;To;; [I"'foo'[-2, 2] # => "oo" ;T; 0o; ; [I"[Special case: returns a new empty \String if +start+ is equal to the length of +self+:;To;; [I"'foo'[3, 2] # => "" ;T; 0o; ; [I".Returns +nil+ if +start+ is out of range:;To;; [I"'foo'[4, 2] # => nil ;TI"'foo'[-4, 2] # => nil ;T; 0o; ; [I"CReturns the trailing substring of +self+ if +length+ is large:;To;; [I"'foo'[1, 50] # => "oo" ;T; 0o; ; [I"+Returns +nil+ if +length+ is negative:;To;; [I"'foo'[0, -1] # => nil ;T; 0o; ; [I"7When the single \Range argument +range+ is given, ;TI"Aderives +start+ and +length+ values from the given +range+, ;TI"!and returns values as above:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"@
'foo'[0..1]
is equivalent to
'foo'[0, 2]
.;To;;0; [o; ; [I"A
'foo'[0...1]
is equivalent to
'foo'[0, 1]
.;T@o; ; [ I"2When the \Regexp argument +regexp+ is given, ;TI"/and the +capture+ argument is
0
, ;TI";returns the first matching substring found in +self+, ;TI"or +nil+ if none found:;To;; [ I"'foo'[/o/] # => "o" ;TI"'foo'[/x/] # => nil ;TI"s = 'hello there' ;TI""s[/[aeiou](.)\1/] # => "ell" ;TI"%s[/[aeiou](.)\1/, 0] # => "ell" ;T; 0o; ; [ I"8If argument +capture+ is given and not
0
, ;TI"eit should be either an \Integer capture group index or a \String or \Symbol capture group name; ;TI"8the method call returns only the specified capture ;TI"H(see {Regexp Capturing}[Regexp.html#class-Regexp-label-Capturing]):;To;; [ I"s = 'hello there' ;TI"#s[/[aeiou](.)\1/, 1] # => "l" ;TI"Hs[/(?
[aeiou])(?
[^aeiou])/, "non_vowel"] # => "l" ;TI"Cs[/(?
[aeiou])(?
[^aeiou])/, :vowel] # => "e" ;T; 0o; ; [I"SIf an invalid capture group index is given, +nil+ is returned. If an invalid ;TI"9capture group name is given, +IndexError+ is raised.;T@o; ; [I"
"oo" ;TI"'foo'['xx'] # => nil ;T; 0o; ; [I",String#slice is an alias for String#[].;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"Éstring[index] -> new_string or nil string[start, length] -> new_string or nil string[range] -> new_string or nil string[regexp, capture = 0] -> new_string or nil string[substring] -> new_string or nil ;T0[[I" slice;T@ I"(*args);T@~FI"String;TcRDoc::NormalClass00