るりまサーチ

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

別のキーワード

  1. _builtin b
  2. string b
  3. b string
  4. b
  5. b _builtin

検索結果

<< 1 2 3 > >>

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

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

...
B
igDecimal 値を 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...

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

第 1 引数 sep で指定されたセパレータによって文字列を 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) と同じ
//...
...][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...
...e'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分割、配列末尾の空文字列は取り除かれる][ruby]{
p "a,b,c,,,".split(/,/, 0) # => ["a", "b", "c"]
//}

//emlist[limit 省略時は 0 と同じ (最もよく使われるパターン)][ruby]{...

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

第 1 引数 sep で指定されたセパレータによって文字列を 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) と同じ
//...
...][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...
...e'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分割、配列末尾の空文字列は取り除かれる][ruby]{
p "a,b,c,,,".split(/,/, 0) # => ["a", "b", "c"]
//}

//emlist[limit 省略時は 0 と同じ (最もよく使われるパターン)][ruby]{...

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

第 1 引数 sep で指定されたセパレータによって文字列を 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) と同じ
//...
...][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...
...e'.split(//).join(':') # => "h:i: :t:h:e:r:e"
//}

//emlist[limit == 0 だと制限なく分割、配列末尾の空文字列は取り除かれる][ruby]{
p "a,b,c,,,".split(/,/, 0) # => ["a", "b", "c"]
//}

//emlist[limit 省略時は 0 と同じ (最もよく使われるパターン)][ruby]{...

WEBrick::HTTPUtils.#split_header_value(str) -> Array (9101.0)

HTTP ヘッダの値を分割して返します。

HTTP ヘッダの値を分割して返します。

@param str HTTP ヘッダの値を返します。

絞り込み条件を変える

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

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

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

FileUtils#split_all(path) -> Array (6119.0)

与えられたパスをディレクトリごとに分割します。

...与えられたパスをディレクトリごとに分割します。

@param path 分割するパスを指定します。

例:
split
_all("a/b/c") # => ['a', 'b', 'c']...

Shellwords.#shellsplit(line) -> [String] (6112.0)

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

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

空白、シングルクォート (')、ダブルクォート (")、バックスラッシュ (\)
を解釈します。

@param line 分割の対象となる文...
...た場合に発生します。

例:
require 'shellwords'

p Shellwords.shellwords(%q{ foo bar "foo bar"\ baz 'foo bar' })
# => ["foo", "bar", "foo bar baz", "foo bar"]

p Shellwords.shellwords(%q{ A B C "D E F" "G","H I" })
# => ["A", "B", "C", "D E F", "G,H I"]...

Thread::ConditionVariable (6018.0)

スレッドの同期機構の一つである状態変数を実現するクラスです。

...である状態変数を実現するクラスです。

以下も ConditionVariable を理解するのに参考になります。

https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF

=== Condition Variable とは

あるスレッド A が排他領域で動いていたとします。...
...以上のような状況を解決するのが Condition Variable です。

スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止めます。他のスレッド b において条件が満たされたなら signal
メソッ...
...foods = 'Apple Banana Strawberry Udon Rice Milk'.split
l = []

th = Thread.new {
for obj in foods
q.send(obj)
print "sent ", obj, "\n"
end
q.send nil
}

l.push th

th = Thread.new {
while obj = q.recv
print "recv ", obj, "\n"...

Rubyの起動 (6006.0)

Rubyの起動 * cmd_option * shebang

...Rubyの起動
* cmd_option
* shebang

Rubyインタプリタの起動は以下の書式のコマンドラインにより行います。

ruby [ option ...] [ -- ] [ programfile ] [ argument ...]

ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプシ...
...Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。

programfile が `#!' で始まるファイルである場合、特殊な解釈
が行われます。詳細は後述のshebang...
...て, オートスプリットモードをONにします。
オートスプリットモードでは各ループの先頭で,
//emlist{
$F = $_.split
//}
が実行されます。`-n'か`-p'オプションが同時に指定されない限り,
このオプションは意味を持ちません...
...emlist{
$F = $_.split
//}
が実行されます。`-n'か`-p'オプションが同時に指定されない限り,
このオプションは意味を持ちません。

: --backtrace-limit=num

バックトレースの最大行数を指定します。

//emlist{
# test.rb
def f6 = raise
def...

絞り込み条件を変える

<< 1 2 3 > >>