D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
String
/
Filename :
partition-i.ri
back
Copy
U:RDoc::AnyMethod[iI"partition:ETI"String#partition;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"7Returns a 3-element array of substrings of +self+.;To:RDoc::Markup::BlankLine o; ; [I"DMatches a pattern against +self+, scanning from the beginning. ;TI"The pattern is:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"2+string_or_regexp+ itself, if it is a Regexp.;To;;0; [o; ; [I"P<tt>Regexp.quote(string_or_regexp)</tt>, if +string_or_regexp+ is a string.;T@o; ; [I"KIf the pattern is matched, returns pre-match, first-match, post-match:;T@o:RDoc::Markup::Verbatim; [ I"8'hello'.partition('l') # => ["he", "l", "lo"] ;TI"8'hello'.partition('ll') # => ["he", "ll", "o"] ;TI"8'hello'.partition('h') # => ["", "h", "ello"] ;TI"8'hello'.partition('o') # => ["hell", "o", ""] ;TI"7'hello'.partition(/l+/) #=> ["he", "ll", "o"] ;TI"8'hello'.partition('') # => ["", "", "hello"] ;TI"@'тест'.partition('т') # => ["", "т", "ест"] ;TI"J'こんにちは'.partition('に') # => ["こん", "に", "ちは"] ;T:@format0o; ; [I"SIf the pattern is not matched, returns a copy of +self+ and two empty strings:;T@o;; [I"3'hello'.partition('x') # => ["hello", "", ""] ;T;0o; ; [I".Related: String#rpartition, String#split.;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"8partition(string_or_regexp) -> [head, match, tail] ;T0[ I" (p1);T@5FI"String;TcRDoc::NormalClass00