るりまサーチ

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

別のキーワード

  1. _builtin partition
  2. enumerable partition
  3. string partition
  4. partition
  5. partition _builtin

ライブラリ

クラス

検索結果

String#partition(sep) -> [String, String, String] (18131.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#...

String#rpartition(sep) -> [String, String, String] (6118.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#split(sep = $;, limit = 0) -> [String] (30.0)

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

...列末尾の空文字列を取り除く
: limit < 0
分割個数の制限はなし

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

@
return ブロックを渡した場合は self、ブロックなしの場合は配列...
...、結果の配列末尾に含まれる空文字列が取り除かれている。
p " a b ".split(' ', 0) # => ["a", "b"]

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

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

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

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

...列末尾の空文字列を取り除く
: limit < 0
分割個数の制限はなし

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

@
return ブロックを渡した場合は self、ブロックなしの場合は配列...
...、結果の配列末尾に含まれる空文字列が取り除かれている。
p " a b ".split(' ', 0) # => ["a", "b"]

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

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

1.6.8から1.8.0への変更点(まとめ) (24.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...することにより定数参照の速度を改善したそうです。
(ChangeLogの
Tue Jun 5 16:15:58 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
に該当するようです)

: break and next [compat]

break, next は、引数を指定することでイテレータや y...
...[new]
: ((<ENV/ENV.update>)) [new]

((<Hash>)) との互換性のために定義されました。

=== Enumerable

: ((<Enumerable#partition|Enumerable/partition>)) [new]

追加

: ((<Enumerable#sort_by|Enumerable/sort_by>)) [new]

追加。((<ruby-dev:8986>))以降で提案された S...
...ました。
((<ruby-dev:18278>))

local ||= 1
@
instance ||= 1
$global ||= 1
@
@class ||= 1

=> -:3: warning: global variable `$global' not initialized
-:4: uninitialized class variable @@class in Object (NameError)
ruby 1.6.7 (2002-03-0...

絞り込み条件を変える

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

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

...限はなしで、配列末尾の空文字列を取り除く
: limit < 0
分割個数の制限はなし

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


//emlist[例][ruby]{
p " a \t b \n c".split(/\s+/) # => ["",...
...、結果の配列末尾に含まれる空文字列が取り除かれている。
p " a b ".split(' ', 0) # => ["a", "b"]

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

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

NEWS for Ruby 3.0.0 (18.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...rue` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis] foundation is
introduced.
* {RBS}[rdo...
...cluster
* String#each_line
* String#gsub
* String#ljust
* String#lstrip
* String#partition
* String#reverse
* String#rjust
* String#rpartition
* String#rstrip
* String#scrub
* String#slice!
* String#slice / String#[]
* Str...
...on uses only methods ending with `!`.
* Ractor compatible.
* Improved support for YAML. 8382
* Use officially discouraged. Read OpenStruct@Caveats section.
* Pathname
* Ractor compatible.
* Psych
* Update to Psych 3.3.0
* This version is Ractor compatible.
* Reline...