種類
- インスタンスメソッド (152)
- 文書 (20)
クラス
-
ARGF
. class (36) - IO (36)
- String (44)
- StringIO (36)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) - codepoints (64)
検索結果
先頭5件
-
ARGF
. class # each _ codepoint -> Enumerator (18120.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (18120.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
String
# each _ codepoint -> Enumerator (18114.0) -
文字列の各コードポイントに対して繰り返します。
...の値になります。
//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 Stri... -
String
# each _ codepoint {|codepoint| block } -> self (18114.0) -
文字列の各コードポイントに対して繰り返します。
...の値になります。
//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 Stri... -
IO
# each _ codepoint -> Enumerator (18108.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
IO
# each _ codepoint {|c| . . . } -> self (18108.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
StringIO
# each _ codepoint -> Enumerator (18108.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
StringIO
# each _ codepoint {|codepoint| . . . } -> self (18108.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
StringIO
# each _ codepoint -> Enumerator (15108.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
StringIO
# each _ codepoint {|codepoint| . . . } -> self (15108.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
String
# codepoints -> [Integer] (28.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...の配列を返します。(self.each_codepoint.to_a と同じです)
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}
ブロックが指定された場合は String#each_codepoint と同じように動作しま......す。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_codepoint... -
String
# codepoints {|codepoint| block } -> self (28.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...の配列を返します。(self.each_codepoint.to_a と同じです)
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}
ブロックが指定された場合は String#each_codepoint と同じように動作しま......す。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_codepoint...