1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

split

Posted at

デフォルトで$;はスペースが入り、それを基準に分割される文字列を分割する

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 splitting self at each occurrence of the given field separator field_sep.

field_sep$;の時

When field_sep is $;:

もし$;nil($;のデフォルト値)ならば、splitはfield_seqが一つの空白として与えられたように同じように分割が起こる。

  • If $; is nil (its default value), the split occurs just as if field_sep were given as a space character (see below).

もし$;は一つの文字列ならば、field_sepはその文字列として与えられた場合と同じように分割が行われる。

  • If $; is a string, the split occurs just as if field_sep were given as that string (see below).

nil
常に $; で分割する。 $; も nil の場合は、先頭と末尾の空白を除いたうえで、空白文字列で分割する。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?