るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle type_ssize_t

検索結果

<< 1 2 3 > >>

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

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

...第 1 引数 sep で指定されたセパレータによって文字列を limit 個まで分割し、
結果を文字列の配列で返します。

第 1 引数 sep は以下のいずれかです。

: 正規表現
正規表現にマッチする部分で分割する。
特に、括弧に...
...除く
: limit < 0
分割個数の制限はなし

@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) # =>...
...、結果の配列末尾に含まれる空文字列が取り除かれている。
p " a b ".split(' ', 0) # => ["a", "b"]

# limit == 1 の場合は元の文字列がそのまま含まれる。
p " a b ".split(' ', 1) # => [" a b "]
//}

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

第 1 引数 sep は以下...
...param limit 分割する最大個数

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

//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(' ') #...

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

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

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

第 1 引数 sep は以下...
...param limit 分割する最大個数

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

//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(' ') #...
...、結果の配列末尾に含まれる空文字列が取り除かれている。
p " a b ".split(' ', 0) # => ["a", "b"]

# limit == 1 の場合は元の文字列がそのまま含まれる。
p " a b ".split(' ', 1) # => [" a b "]
//}

@see String#partition, String#rpartition...

String#shellsplit -> [String] (33313.0)

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

...分割を行い、
単語 (文字列) の配列を返します。

string
.shellsplit は、Shellwords.shellsplit(string) と等価です。

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

String#partition(sep) -> [String, String, String] (30521.0)

セパレータ sep が最初に登場する部分で self を 3 つに分割し、 [最初のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。

...@param sep セパレータを表す文字列か正規表現を指定します。

//emlist[例][ruby]{
p "axaxa".partition("x") # => ["a", "x", "axa"]
p "aaaaa".partition("x") # => ["aaaaa", "", ""]
p "aaaaa".partition("") # => ["", "", "aaaaa"]
//}

@see String#rpartition, String#split...

String#rpartition(sep) -> [String, String, String] (30521.0)

セパレータ sep が最後に登場する部分で self を 3 つに分割し、 [最後のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。

...と第 2 要素が空文字列になります。

@param sep セパレータを表す文字列か正規表現を指定します。

//emlist[例][ruby]{
p "axaxa".rpartition("x") # => ["axa", "x", "a"]
p "aaaaa".rpartition("x") # => ["", "", "aaaaa"]
//}

@see String#partition, String#split...

絞り込み条件を変える

String#unpack(template) -> Array (24332.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...ンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。

@param template pack テンプレート文字列
@return オブジェクトの配列


以下にあげるものは、Array#pack、String#unpack
のテンプレ...
...ト文字のシステム依存性

各テンプレート文字の説明の中で、
short や long はシステムによらずそれぞれ 2, 4バイトサ
イズの数値(32ビットマシンで一般的なshort, longのサイズ)を意味していま
す。s, S, l, L に対しては直後に _ ま...
...来る
//emlist[][ruby]{
"Ru\x00\x00by".unpack('ccxxcc') # => [82, 117, 98, 121]
//}

: Hexダンプを数値の配列に変換する例
//emlist[][ruby]{
"61 62 63 64 65 66".delete(' ').lines.pack('H*').unpack('C*')
# => [97, 98, 99, 100, 101, 102]

"61 62 63 64 65 66".split.collect {|c| c.hex}...
...ート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。

@param template pack テンプレート文字列
@return オブジェクトの配列


以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテ...

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

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

...emlist[][ruby]{
require "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 = f*(s.to_f)...
...*(y**z)
//}

@see BigDecimal#to_f...

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

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

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

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

@see File.split...

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

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

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

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

@see File.split...

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

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

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

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

@see File.split...

絞り込み条件を変える

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

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

...ost
* port
* registry
* path
* opaque
* query
* fragment

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

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

例:
require 'uri'
p URI.split("http://www.ruby-lang.org/")
#=> ["http"...
<< 1 2 3 > >>