るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

検索結果

<< 1 2 3 ... > >>

Symbol#slice(substr) -> String | nil (15128.0)

self が substr を含む場合、一致した文字列を新しく作って返します。

...self が substr を含む場合、一致した文字列を新しく作って返します。

(self.to_s[substr] と同じです。)

例:
:foobar.slice("foo") # => "foo"
:foobar.slice("baz") # => nil...

Symbol#slice(range) -> String | nil (15123.0)

rangeで指定したインデックスの範囲に含まれる部分文字列を返します。

...rangeで指定したインデックスの範囲に含まれる部分文字列を返します。

(self.to_s[range] と同じです。)

@param range 取得したい文字列の範囲を示す Range オブジェクトを指定します。

:foo[0..1] # => "fo"

@see String#[] , String#slice...

Symbol#slice(nth) -> String | nil (15118.0)

nth 番目の文字を返します。

...nth 番目の文字を返します。

(self.to_s[nth] と同じです。)

@param nth 文字の位置を表す整数を指定します。

:foo[0] # => "f"
:foo[1] # => "o"
:foo[2] # => "o"...

Symbol#slice(nth, len) -> String | nil (15118.0)

nth 番目から長さ len の部分文字列を新しく作って返します。

...nth 番目から長さ len の部分文字列を新しく作って返します。

(self.to_s[nth, len] と同じです。)

@param nth 文字の位置を表す整数を指定します。
@param len 文字列の長さを指定します。

:foo[1, 2] # => "oo"...

Symbol#slice(regexp, nth = 0) -> String | nil (15118.0)

正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。

...正規表現 regexp の nth 番目の括弧にマッチする最初の部分文字列を返します。

(self.to_s[regexp, nth] と同じです。)

@param regexp 正規表現を指定します。

@param nth 取得したい正規表現レジスタのインデックスを指定します。

:foo...

絞り込み条件を変える

Enumerator::Lazy#slice_before {|elt| bool } -> Enumerator::Lazy (9237.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

Enumerator::Lazy#slice_before(initial_state) {|elt, state| bool } -> Enumerator::Lazy (9237.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

Enumerator::Lazy#slice_before(pattern) -> Enumerator::Lazy (9237.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (9236.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...
...e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...
<< 1 2 3 ... > >>