るりまサーチ

最速Rubyリファレンスマニュアル検索!
165件ヒット [1-100件を表示] (0.198秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Array#slice(nth) -> object | nil (24239.0)

指定された自身の要素を返します。Array#[] と同じです。

...指定された自身の要素を返します。Array#[] と同じです。

@param nth 要素のインデックスを整数で指定します。Array#[] と同じです。

//emlist[例][ruby]{
p [0, 1, 2].slice(1) #=> 1
p [0, 1, 2].slice(2) #=> 2
p [0, 1, 2].slice(10) #=> nil
//}...

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (21549.0)

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

...numerable#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 }.take(...
...5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...

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

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

...numerable#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 }.take(...
...5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...

String#byteslice(nth) -> String | nil (21425.0)

nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。

...nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。
引数が範囲外を指定した場合は nil を返します。

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

@return 切り出した文字列を返します。戻り値の...
...文字エンコーディングは自身
と同じです。

//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0) # => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}

@see String#slice...

String#byteslice(nth, len=1) -> String | nil (21425.0)

nth バイト目から長さ len バイトの部分文字列を新しく作って返します。 nth が負の場合は文字列の末尾から数えます。引数が範囲外を指定した場合は nil を返します。

...nth バイト目から長さ len バイトの部分文字列を新しく作って返します。
nth が負の場合は文字列の末尾から数えます。引数が範囲外を指定した場合は
nil を返します。

@param nth 取得したい文字列の開始バイトを整数で指定し...
...ram len 取得したい文字列の長さを正の整数で指定します。

@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。

//emlist[例][ruby]{
"hello".byteslice(1, 2) # => "el"
"\u3042\u3044\u3046".by...
...teslice(0, 3) # => "\u3042"
//}

@see String#slice...
...teslice(0, 3) # => "\u3042"
//}

@see String#slice
@see String#bytesplice...

絞り込み条件を変える

String#byteslice(range) -> String | nil (21425.0)

range で指定したバイトの範囲に含まれる部分文字列を返します。引数が範囲 外を指定した場合は nil を返します。

...
r
ange で指定したバイトの範囲に含まれる部分文字列を返します。引数が範囲
外を指定した場合は nil を返します。

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

@return 切り出した文字列を返します。戻り値の...
...文字エンコーディングは自身
と同じです。

//emlist[例][ruby]{
"hello".byteslice(1..2) # => "el"
"\x03\u3042\xff".byteslice(1..3) # => "\u3042"
//}

@see String#slice...
...文字エンコーディングは自身
と同じです。

//emlist[例][ruby]{
"hello".byteslice(1..2) # => "el"
"\x03\u3042\xff".byteslice(1..3) # => "\u3042"
//}

@see String#slice
@see String#bytesplice...

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

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

...umerable#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 }.take...
...(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 (18450.0)

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

...umerable#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 }.take...
...(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 (18450.0)

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

...umerable#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 }.take...
...(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...
<< 1 2 > >>