ライブラリ
- ビルトイン (733)
-
bigdecimal
/ util (12) - kconv (24)
- rake (24)
- scanf (12)
キーワード
- % (12)
- [] (72)
-
append
_ as _ bytes (1) - byteindex (3)
- byterindex (3)
- bytesplice (5)
- casecmp (12)
- casecmp? (9)
- center (12)
- codepoints (24)
- dedup (3)
- delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) - downcase (12)
- downcase! (12)
- dump (12)
-
each
_ codepoint (24) - encode (36)
- encode! (24)
- encoding (12)
-
end
_ with? (12) -
force
_ encoding (12) - getbyte (12)
- gsub (12)
- gsub! (12)
- include? (12)
- index (12)
- iseuc (12)
- kconv (12)
- ljust (12)
- match (12)
- ord (12)
- pathmap (12)
-
pathmap
_ explode (12) - prepend (21)
- rindex (12)
- rjust (12)
- scanf (12)
- setbyte (12)
- slice (72)
- split (19)
-
start
_ with? (8) - sub (12)
- sub! (12)
-
to
_ d (12) -
to
_ i (12) - tr (12)
- undump (8)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
-
valid
_ encoding? (12)
検索結果
先頭5件
-
String
# delete(*strs) -> String (6102.0) -
self から strs に含まれる文字を取り除いた文字列を生成して返します。
...合は、
すべての引数にマッチする文字だけが削除されます。
@param strs 削除する文字列を示す文字列 (のリスト)
//emlist[例][ruby]{
p "123456789".delete("2378") #=> "14569"
p "123456789".delete("2-8", "^4-6") #=> "14569"
//}
@see String#delete!... -
String
# delete _ prefix!(prefix) -> self | nil (6102.0) -
self の先頭から破壊的に prefix を削除します。
...ら削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefix
@see String#delete_suffix!
@see String#start_with?... -
String
# delete _ prefix(prefix) -> String (6102.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
...する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_suffix
@see String#start_with?... -
String
# delete _ suffix!(suffix) -> self | nil (6102.0) -
self の末尾から破壊的に suffix を削除します。
...ます。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}
@see String#chomp!
@see String#chop!
@see String#delete_prefix!
@see String#delete_suffix
@see String#end_with?... -
String
# delete _ suffix(suffix) -> String (6102.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
...。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}
@see String#chomp
@see String#chop
@see String#delete_prefix
@see String#delete_suffix!
@see String#end_with?... -
String
# downcase -> String (6102.0) -
'A' から 'Z' までの アルファベット大文字をすべて小文字に置き換えた新しい文字列を生成して返します。 アルファベット大文字以外の文字はすべてそのまま保存されます。
...「1 文字を 1 文字として認識する」だけであって、
いわゆる全角アルファベットの大文字小文字までは変換しません。
//emlist[例][ruby]{
p "STRing?".downcase # => "string?"
//}
@see String#downcase!, String#upcase, String#swapcase, String#capitalize... -
String
# downcase! -> self | nil (6102.0) -
文字列中の 'A' から 'Z' までの アルファベット大文字をすべて破壊的に小文字に置き換えます。 アルファベット大文字以外の文字はすべてそのまま保存されます。
...文字小文字までは変換しません。
@return self を変更して返します。変更が無かった場合は nil を返します。
//emlist[例][ruby]{
str = "STRing?"
str.downcase!
p str # => "string?"
//}
@see String#downcase, String#upcase!, String#swapcase!, String#capitalize!... -
String
# downcase!(*options) -> self | nil (6102.0) -
全ての大文字を対応する小文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...細は String#downcase を参照してください。
@return self を変更して返します。変更が無かった場合は nil を返します。
//emlist[例][ruby]{
str = "STRing?"
str.downcase!
p str # => "string?"
//}
@see String#downcase, String#upcase!, String#swapcase!, String#capita... -
String
# downcase(*options) -> String (6102.0) -
全ての大文字を対応する小文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...以下の通りです。
: オプションなし
完全な Unicode ケースマッピングに対応し、ほとんどの言語に適しています。(例外は以下の :turkic,
:lithuanian オプションを参照)
Unicode 標準の表 3-14 で説明されている、コンテキスト依......など) に適合した完全な Unicode ケースマッピングです。
これはたとえば大文字の I は小文字のドットなしの i (ı) にマッピングされることを意味します。
: :lithuanian
現在は、ただの完全な Unicode ケースマッピングです。......に対応した完全な Unicode ケースマッピングです。
(上にアクセントがあっても小文字の i のドットを維持します。)
: :fold
downcase と downcase! のみで使えます。
Unicode ケースフォールディングは Unicode ケースマッピングより... -
String
# dump -> String (6102.0) -
文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。
...に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x00\b10\\\""
//}......文字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x00\b10\\\""
//}
@see String#undump... -
String
# each _ codepoint -> Enumerator (6102.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
# encode!(encoding , from _ encoding , options = nil) -> self (6102.0) -
self を指定したエンコーディングに変換し、自身を置き換えます。引数を2つ 与えた場合、第二引数は変換元のエンコーディングを意味します。そうでない場合は self のエンコーディングが使われます。変換後の self を返します。
...なくても self を返します。
@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@ret......urn 変換後のself
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode!("EUC-JP")
s.encode!(Encoding::UTF_8)
//}
@see String#encode... -
String
# encode!(encoding , options = nil) -> self (6102.0) -
self を指定したエンコーディングに変換し、自身を置き換えます。引数を2つ 与えた場合、第二引数は変換元のエンコーディングを意味します。そうでない場合は self のエンコーディングが使われます。変換後の self を返します。
...なくても self を返します。
@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@ret......urn 変換後のself
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode!("EUC-JP")
s.encode!(Encoding::UTF_8)
//}
@see String#encode...