751件ヒット
[1-100件を表示]
(0.130秒)
ライブラリ
- ビルトイン (329)
-
net
/ pop (108) -
net
/ smtp (36) - resolv (12)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - socket (12)
- stringio (176)
-
win32
/ registry (12) - win32ole (48)
クラス
-
ARGF
. class (12) - Array (21)
- BasicSocket (12)
- Enumerator (24)
- Module (12)
-
Net
:: POPMail (108) -
Net
:: SMTP (36) -
Resolv
:: DNS (12) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - String (260)
- StringIO (176)
-
WIN32OLE
_ VARIABLE (48) -
Win32
:: Registry (12)
キーワード
- all (36)
- bytes (38)
- chars (38)
- codepoints (38)
-
each
_ byte (48) -
each
_ char (48) -
each
_ codepoint (48) -
each
_ grapheme _ cluster (16) -
each
_ key (12) -
each
_ line (48) -
each
_ resource (12) - echo (18)
-
grapheme
_ clusters (16) -
inplace
_ mode (12) -
instance
_ method (12) - lines (38)
- mail (36)
- name (12)
-
ole
_ type (12) -
ole
_ type _ detail (12) - pack (21)
- pop (36)
- recvmsg (12)
-
send
_ mail (12) - sendmail (12)
- sum (12)
-
to
_ s (12) - unpack (12)
- upto (12)
-
with
_ object (24)
検索結果
先頭5件
-
String
# each _ grapheme _ cluster -> Enumerator (27133.0) -
文字列の書記素クラスタに対して繰り返します。
...。
String#each_char と違って、
Unicode Standard Annex #29 (https://unicode.org/reports/tr29/)
で定義された書記素クラスタに対して繰り返します。
//emlist[例][ruby]{
"a\u0300".each_char.to_a.size # => 2
"a\u0300".each_grapheme_cluster.to_a.size # => 1
//}
@see String#g... -
String
# each _ grapheme _ cluster {|grapheme _ cluster| block } -> self (27133.0) -
文字列の書記素クラスタに対して繰り返します。
...。
String#each_char と違って、
Unicode Standard Annex #29 (https://unicode.org/reports/tr29/)
で定義された書記素クラスタに対して繰り返します。
//emlist[例][ruby]{
"a\u0300".each_char.to_a.size # => 2
"a\u0300".each_grapheme_cluster.to_a.size # => 1
//}
@see String#g... -
String
# each _ byte -> Enumerator (27121.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 (27121.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 _ codepoint -> Enumerator (27121.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 String#codepoints... -
String
# each _ codepoint {|codepoint| block } -> self (27121.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 String#codepoints... -
String
# each _ char -> Enumerator (27115.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
String
# each _ char {|cstr| block } -> self (27115.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
String
# each _ line(rs = $ / ) -> Enumerator (27115.0) -
文字列中の各行に対して繰り返します。 行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。 各 line には区切りの文字列も含みます。
...で文字列を分割します
(つまり空行で分割します)。
@param rs 行末を示す文字列
//emlist[例][ruby]{
"aa\nbb\ncc\n".each_line do |line|
p line
end
# => "aa\n"
# => "bb\n"
# => "cc\n"
p "aa\nbb\ncc\n".lines.to_a # => ["aa\n", "bb\n", "cc\n"]
p "aa\n".lin......es.to_a # => ["aa\n"]
p "".lines.to_a # => []
s = "aa\nbb\ncc\n"
p s.lines("\n").to_a #=> ["aa\n", "bb\n", "cc\n"]
p s.lines("bb").to_a #=> ["aa\nbb", "\ncc\n"]
//}
@see String#lines... -
String
# each _ line(rs = $ / ) {|line| . . . } -> self (27115.0) -
文字列中の各行に対して繰り返します。 行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。 各 line には区切りの文字列も含みます。
...で文字列を分割します
(つまり空行で分割します)。
@param rs 行末を示す文字列
//emlist[例][ruby]{
"aa\nbb\ncc\n".each_line do |line|
p line
end
# => "aa\n"
# => "bb\n"
# => "cc\n"
p "aa\nbb\ncc\n".lines.to_a # => ["aa\n", "bb\n", "cc\n"]
p "aa\n".lin......es.to_a # => ["aa\n"]
p "".lines.to_a # => []
s = "aa\nbb\ncc\n"
p s.lines("\n").to_a #=> ["aa\n", "bb\n", "cc\n"]
p s.lines("bb").to_a #=> ["aa\nbb", "\ncc\n"]
//}
@see String#lines... -
String
# each _ line(rs = $ / , chomp: false) -> Enumerator (27115.0) -
文字列中の各行に対して繰り返します。 行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。 各 line には区切りの文字列も含みます。
...行末を示す文字列
@param chomp true を指定すると各行の末尾から rs を取り除きます。
//emlist[例][ruby]{
"aa\nbb\ncc\n".each_line do |line|
p line
end
# => "aa\n"
# => "bb\n"
# => "cc\n"
p "aa\nbb\ncc\n".lines.to_a # => ["aa\n", "bb\n", "cc\n"]
p "aa\n".l......ines.to_a # => ["aa\n"]
p "".lines.to_a # => []
s = "aa\nbb\ncc\n"
p s.lines("\n").to_a #=> ["aa\n", "bb\n", "cc\n"]
p s.lines("bb").to_a #=> ["aa\nbb", "\ncc\n"]
//}
@see String#lines...