⚝
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 :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
String
/
View File Name :
split-i.ri
U:RDoc::AnyMethod[iI" split:ETI"String#split;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QDivides
str
into substrings based on a delimiter, returning an array ;TI"of these substrings.;To:RDoc::Markup::BlankLine o; ; [ I"BIf
pattern
is a String, then its contents are used as ;TI"Lthe delimiter when splitting
str
. If
pattern
is a single ;TI"Ispace,
str
is split on whitespace, with leading and trailing ;TI"Ewhitespace and runs of contiguous whitespace characters ignored.;T@o; ; [ I"DIf
pattern
is a Regexp,
str
is divided where the ;TI"Ipattern matches. Whenever the pattern matches a zero-length string, ;TI"P
str
is split into individual characters. If
pattern
contains ;TI"Jgroups, the respective matches will be returned in the array as well.;T@o; ; [I"RIf
pattern
is
nil
, the value of
$;
is used. ;TI"RIf
$;
is
nil
(which is the default),
str
is ;TI"2split on whitespace as if ' ' were specified.;T@o; ; [ I"HIf the
limit
parameter is omitted, trailing null fields are ;TI"Ksuppressed. If
limit
is a positive number, at most that number ;TI"Lof split substrings will be returned (captured groups will be returned ;TI"6as well, but are not counted towards the limit). ;TI"3If
limit
is
1
, the entire ;TI"Pstring is returned as the only entry in an array. If negative, there is no ;TI"Nlimit to the number of fields returned, and trailing null fields are not ;TI"suppressed.;T@o; ; [I"OWhen the input +str+ is empty an empty Array is returned as the string is ;TI"+considered to have no fields to split.;T@o:RDoc::Markup::Verbatim; [I"B" now's the time ".split #=> ["now's", "the", "time"] ;TI"B" now's the time ".split(' ') #=> ["now's", "the", "time"] ;TI"J" now's the time".split(/ /) #=> ["", "now's", "", "the", "time"] ;TI"B"1, 2.34,56, 7".split(%r{,\s*}) #=> ["1", "2.34", "56", "7"] ;TI"C"hello".split(//) #=> ["h", "e", "l", "l", "o"] ;TI";"hello".split(//, 3) #=> ["h", "e", "llo"] ;TI"C"hi mom".split(%r{\s*}) #=> ["h", "i", "m", "o", "m"] ;TI" ;TI";"mellow yellow".split("ello") #=> ["m", "w y", "w"] ;TI"B"1,2,,3,4,,".split(',') #=> ["1", "2", "", "3", "4"] ;TI"A"1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"] ;TI"J"1,2,,3,4,,".split(',', -4) #=> ["1", "2", "", "3", "4", "", ""] ;TI" ;TI"C"1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"] ;TI" ;TI","".split(',', -1) #=> [] ;T:@format0o; ; [I"EIf a block is given, invoke the block with each split substring.;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"vstr.split(pattern=nil, [limit]) -> an_array str.split(pattern=nil, [limit]) {|sub| block } -> str ;T0[ I"(p1 = v1, p2 = v2);T@DFI"String;TcRDoc::NormalClass00