1016件ヒット
[501-600件を表示]
(0.041秒)
別のキーワード
種類
- インスタンスメソッド (997)
- 特異メソッド (19)
ライブラリ
- ビルトイン (950)
-
bigdecimal
/ util (11) - kconv (44)
- rake (11)
キーワード
- % (11)
- + (11)
- == (11)
- === (11)
- [] (66)
- []= (11)
-
ascii
_ only? (11) - byteindex (2)
- byterindex (2)
- bytes (22)
- bytesize (11)
- byteslice (33)
- bytesplice (4)
- casecmp? (8)
- chars (11)
- codepoints (11)
- dump (11)
-
each
_ byte (22) -
each
_ char (11) -
each
_ codepoint (11) -
each
_ grapheme _ cluster (7) - empty? (11)
- encode (33)
-
end
_ with? (11) - eql? (11)
- getbyte (11)
-
grapheme
_ clusters (7) - gsub (44)
- gsub! (44)
- include? (11)
- intern (11)
- iseuc (11)
- isjis (11)
- issjis (11)
- isutf8 (11)
- match (11)
- match? (8)
- new (8)
- next (11)
- next! (11)
- oct (11)
- pathmap (11)
- scan (22)
- scrub (33)
- scrub! (33)
- setbyte (11)
- slice (66)
- slice! (11)
- split (17)
-
start
_ with? (11) - sub (33)
- sub! (33)
- succ (11)
- succ! (11)
- sum (11)
-
to
_ d (11) -
to
_ i (11) -
to
_ sym (11) -
try
_ convert (11) -
unicode
_ normalized? (10) - unpack (11)
- unpack1 (8)
- upto (11)
-
valid
_ encoding? (11)
検索結果
先頭5件
-
String
# each _ char {|cstr| block } -> self (101.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
String
# each _ codepoint {|codepoint| block } -> self (101.0) -
文字列の各コードポイントに対して繰り返します。
...の各コードポイントに対して繰り返します。
UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE) 以外のエンコーディングに対しては
各文字のバイナリ表現由来の値になります。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 1......08, 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 _ grapheme _ cluster {|grapheme _ cluster| block } -> self (101.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
# empty? -> bool (101.0) -
文字列が空 (つまり長さ 0) の時、真を返します。
...文字列が空 (つまり長さ 0) の時、真を返します。
//emlist[例][ruby]{
"hello".empty? #=> false
" ".empty? #=> false
"".empty? #=> true
//}... -
String
# end _ with?(*strs) -> bool (101.0) -
self の末尾が strs のいずれかであるとき true を返します。
...ずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#start_with?......@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#start_with?
@see String#delete_suffix, String#delete_suffix!... -
String
# eql?(other) -> bool (101.0) -
文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。
...りません。
つまり、"string".eql?(str) という式を実行した場合には、
str が "string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってくださ......、String#upcase,
String#downcase で大文字小文字を揃えてから比較してください。
Hash クラス内での比較に使われます。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".e......ql?("STRING") # => false
p "string".eql?("") # => false
p "".eql?("string") # => false
p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)
p "string".upcase.eql?("String".upcase) # =>......場合は
String#casecmp? を使ってください。
Hash クラス内での比較に使われます。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".eql?("STRING") # => false
p "string".eql?("")......# => false
p "".eql?("string") # => false
p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)
//}
@see Hash, String#<=>, String#casecmp, String#==... -
String
# grapheme _ clusters {|grapheme _ cluster| block } -> self (101.0) -
文字列の書記素クラスタの配列を返します。(self.each_grapheme_cluster.to_a と同じです)
...emlist[例][ruby]{
"a\u0300".grapheme_clusters # => ["à"]
//}
ブロックが指定された場合は String#each_grapheme_cluster と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_graphem... -
String
# include?(substr) -> bool (101.0) -
文字列中に部分文字列 substr が含まれていれば真を返します。
...文字列中に部分文字列 substr が含まれていれば真を返します。
@param substr 検索する文字列
//emlist[例][ruby]{
"hello".include? "lo" #=> true
"hello".include? "ol" #=> false
"hello".include? ?h #=> true
//}... -
String
# intern -> Symbol (101.0) -
文字列に対応するシンボル値 Symbol を返します。
...値 Symbol を返します。
なお、このメソッドの逆にシンボルに対応する文字列を得るには
Symbol#to_s または Symbol#id2name を使います。
シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。
//emlist[例][ruby]{
p... -
String
# iseuc -> bool (101.0) -
self が EUC-JP なバイト列として正当であるかどうかを判定します。
...ます。
Kconv.#iseuc(self) と同じです。
//emlist[例][ruby]{
require 'kconv'
euc_str = "\
\xa5\xaa\xa5\xd6\xa5\xb8\xa5\xa7\xa5\xaf\xa5\xc8\xbb\xd8\xb8\xfe\
\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\
\x52\x75\x62\x79".force_encoding('EUC-JP')
sjis_str = "\
\......x83\x49\x83\x75\x83\x57\x83\x46\x83\x4e\x83\x67\x8e\x77\x8c\xfc\
\x83\x76\x83\x8d\x83\x4f\x83\x89\x83\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea\
\x52\x75\x62\x79".force_encoding('Shift_JIS')
euc_str.iseuc # => true
sjis_str.iseuc # => false
//}... -
String
# isjis -> bool (101.0) -
self が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
self が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
Kconv.isjis(self) と同じです。