るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

String#bytes -> [Integer] (18137.0)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

...文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}

ブロックが指定された場合は String#each_byte と同じように動作します。

Ruby 2.6 までは deprecated の警告が出...
...ますが、Ruby 2.7 で警告は削除されました。

@see String#each_byte...

String#bytes {|byte| ... } -> self (18137.0)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

...文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}

ブロックが指定された場合は String#each_byte と同じように動作します。

Ruby 2.6 までは deprecated の警告が出...
...ますが、Ruby 2.7 で警告は削除されました。

@see String#each_byte...

String#each_byte -> Enumerator (18121.0)

文字列の各バイトに対して繰り返します。

...文字列の各バイトに対して繰り返します。

//emlist[例][ruby]{
"str".each_byte do |byte|
p byte
end
# => 115
# => 116
# => 114

"あ".each_byte do |byte|
p byte
end
# => 227
# => 129
# => 130
//}

@see String#bytes...

String#each_byte {|byte| ... } -> self (18121.0)

文字列の各バイトに対して繰り返します。

...文字列の各バイトに対して繰り返します。

//emlist[例][ruby]{
"str".each_byte do |byte|
p byte
end
# => 115
# => 116
# => 114

"あ".each_byte do |byte|
p byte
end
# => 227
# => 129
# => 130
//}

@see String#bytes...