るりまサーチ

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

別のキーワード

  1. string encode
  2. _builtin encode
  3. string encode!
  4. uri encode_www_form_component
  5. uri encode_www_form

ライブラリ

検索結果

String#each_codepoint {|codepoint| block } -> self (27227.0)

文字列の各コードポイントに対して繰り返します。

...(BE|LE)/UTF-32(BE|LE) 以外のエンコーディングに対しては
各文字のバイナリ表現由来の値になります。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode(...
...'euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...