るりまサーチ

最速Rubyリファレンスマニュアル検索!
472件ヒット [1-100件を表示] (0.114秒)
トップページ > クエリ:r[x] > クエリ:split[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. bigdecimal to_r

検索結果

<< 1 2 3 ... > >>

void rb_parser_while_loop(int chop, int split) (26200.0)

ruby の -n オプションの実装。 ループと print のノードを ruby_eval_tree に加えます。

...
r
uby の -n オプションの実装。
ループと print のノードを ruby_eval_tree に加えます。...

String#split(sep = $;, limit = 0) -> [String] (21346.0)

第 1 引数 sep で指定されたセパレータによって文字列を limit 個まで分割し、 結果を文字列の配列で返します。 ブロックを指定すると、配列を返す代わりに分割した文字列で ブロックを呼び出します。

...

@param sep 文字列を分割するときのセパレータのパターン
@param limit 分割する最大個数


//emlist[例][ruby]{
p " a \t b \n c".split(/\s+/) # => ["", "a", "b", "c"]

p " a \t b \n c".split(nil) # => ["a", "b", "c"]
p " a \t b \n c".split(' ')...
...# => ["a", "b", "c"] # split(nil) と同じ
p " a \t b \n c".split # => ["a", "b", "c"] # split(nil) と同じ
//}

//emlist[括弧を含む正規表現][ruby]{
p '1-10,20'.split(/([-,])/) # => ["1", "-", "10", ",", "20"]
//}

//emlist[正規表現が空文字列にマッチする...
...場合は 1 文字に分割][ruby]{
p 'hi there'.split(/\s*/).join(':') # => "h:i:t:h:e:r:e"
//}

//emlist[文字列全体を 1 文字ずつに分割する例][ruby]{
p 'hi there'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分割、配列末尾の空...
...の制限はなし

@param sep 文字列を分割するときのセパレータのパターン
@param limit 分割する最大個数

@return ブロックを渡した場合は self、ブロックなしの場合は配列

//emlist[例][ruby]{
p " a \t b \n c".split(/\s+/) # => ["", "a",...
..." a \t b \n c".split(nil) # => ["a", "b", "c"]
p " a \t b \n c".split(' ') # => ["a", "b", "c"] # split(nil) と同じ
p " a \t b \n c".split # => ["a", "b", "c"] # split(nil) と同じ
//}

//emlist[括弧を含む正規表現][ruby]{
p '1-10,20'.split(/([-,])/) # => [...
...字列にマッチする場合は 1 文字に分割][ruby]{
p 'hi there'.split(/\s*/).join(':') # => "h:i:t:h:e:r:e"
//}

//emlist[文字列全体を 1 文字ずつに分割する例][ruby]{
p 'hi there'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分...

String#split(sep = $;, limit = 0) {|s| ... } -> self (21246.0)

第 1 引数 sep で指定されたセパレータによって文字列を limit 個まで分割し、 結果を文字列の配列で返します。 ブロックを指定すると、配列を返す代わりに分割した文字列で ブロックを呼び出します。

...の制限はなし

@param sep 文字列を分割するときのセパレータのパターン
@param limit 分割する最大個数

@return ブロックを渡した場合は self、ブロックなしの場合は配列

//emlist[例][ruby]{
p " a \t b \n c".split(/\s+/) # => ["", "a",...
..." a \t b \n c".split(nil) # => ["a", "b", "c"]
p " a \t b \n c".split(' ') # => ["a", "b", "c"] # split(nil) と同じ
p " a \t b \n c".split # => ["a", "b", "c"] # split(nil) と同じ
//}

//emlist[括弧を含む正規表現][ruby]{
p '1-10,20'.split(/([-,])/) # => [...
...字列にマッチする場合は 1 文字に分割][ruby]{
p 'hi there'.split(/\s*/).join(':') # => "h:i:t:h:e:r:e"
//}

//emlist[文字列全体を 1 文字ずつに分割する例][ruby]{
p 'hi there'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分...

Shell::CommandProcessor#split(pathname) -> [String] (21207.0)

File クラスにある同名のクラスメソッドと同じです.

...File クラスにある同名のクラスメソッドと同じです.

@param pathname パス名を表す文字列を指定します。

@see File.split...

Shell::Filter#split(pathname) -> [String] (21207.0)

File クラスにある同名のクラスメソッドと同じです.

...File クラスにある同名のクラスメソッドと同じです.

@param pathname パス名を表す文字列を指定します。

@see File.split...

絞り込み条件を変える

URI.split(url) -> [String | nil] (21207.0)

URI を要素に分割した文字列の配列を返します。

...URI を要素に分割した文字列の配列を返します。

各要素の種類と順番は以下のとおりです。

* scheme
* userinfo
* host
* port
* registry
* path
* opaque
* query
* fragment

@param url パースしたい URI を文字列として与えます。

@ra...
...ise URI::InvalidURIError パースに失敗した場合に発生します。

例:
r
equire 'uri'
p URI.split("http://www.ruby-lang.org/")
#=> ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]...

Shellwords.split(line) -> [String] (21201.0)

Bourne シェルの単語分割規則に従った空白区切りの単語分割を行い、 単語 (文字列) の配列を返します。

...Bourne シェルの単語分割規則に従った空白区切りの単語分割を行い、
単語 (文字列) の配列を返します。

このメソッドは、Shellwords.#shellsplit の別名です。

@param line 分割の対象となる文字列を指定します。
@return 分割結果の各...
...文字列を要素とする配列を返します。
@raise ArgumentError 引数の中に対でないシングルクォートまたはダブル
クォートが現れた場合に発生します。...

BigDecimal#split -> [Integer, String, Integer, Integer] (18307.0)

BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、 符号 (NaNのときは 0、それ以外は+1か-1になります)、 仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。

...す。

//emlist[][ruby]{
r
equire "bigdecimal"
a = BigDecimal("3.14159265")
f, x, y, z = a.split
//}

とすると、f = 1、x = "314159265"、y = 10、z = 1 になります。
従って、以下のようにする事で Float に変換することができます。

//emlist[][ruby]{
s = "0."+x
b =...

Pathname#split -> Array (18229.0)

File.split(self.to_s) と同じです。

...File.split(self.to_s) と同じです。

//emlist[例][ruby]{
r
equire "pathname"

pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}

@see File.split...

Shell#split(pathname) -> [String] (18207.0)

File クラスにある同名のクラスメソッドと同じです.

...File クラスにある同名のクラスメソッドと同じです.

@param pathname パス名を表す文字列を指定します。

@see File.split...

絞り込み条件を変える

File.split(pathname) -> [String] (18201.0)

pathname を dirname とbasename に分割して、2 要 素の配列を返します。

...pathname を dirname とbasename に分割して、2 要
素の配列を返します。

//emlist[][ruby]{
[File.dirname(pathname), File.basename(pathname)]
//}

と同じです。

@param pathname パス名を表す文字列を指定します。...
<< 1 2 3 ... > >>