デフォルトで$;
はスペースが入り、それを基準に分割される文字列を分割する
split(field_sep = $;, limit = 0) → array
split(field_sep = $;, limit = 0) {|substring| ... } → self
与えられたフィールドセパレーターfield_sep
の発生ごとにselfを割っている結果のselfの部分文字列の配列を返す。
Returns an array of substrings of
self
that are the result of splittingself
at each occurrence of the given field separatorfield_sep
.
field_sep
が$;
の時
When
field_sep
is$;
:
もし$;
がnil
($;
のデフォルト値)ならば、splitはfield_seq
が一つの空白として与えられたように同じように分割が起こる。
- If
$;
isnil
(its default value), the split occurs just as iffield_sep
were given as a space character (see below).
もし$;
は一つの文字列ならば、field_sep
はその文字列として与えられた場合と同じように分割が行われる。
- If
$;
is a string, the split occurs just as iffield_sep
were given as that string (see below).
nil
常に $; で分割する。 $; も nil の場合は、先頭と末尾の空白を除いたうえで、空白文字列で分割する。