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"OIf pattern is a String
, then its contents are used as ;TI"Lthe delimiter when splitting str. If pattern is a single ;TI"Pspace, str is split on whitespace, with leading whitespace and runs ;TI"1of contiguous whitespace characters ignored.;T@o;
; [ I"QIf pattern is a Regexp
, str is divided where the ;TI"Ipattern matches. Whenever the pattern matches a zero-length string, ;TI"Pstr 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:@format0:
@fileI"
string.c;T:0@omit_headings_from_table_of_contents_below0I"3str.split(pattern=nil, [limit]) -> an_array
;T0[ I"(p1 = v1, p2 = v2);T@AFI"String;TcRDoc::NormalClassI"
scanf;T0