84件ヒット
[1-84件を表示]
(0.053秒)
別のキーワード
ライブラリ
- ビルトイン (84)
キーワード
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) -
end
_ with? (8) -
start
_ with? (8) - unpack (12)
検索結果
先頭5件
-
String
# delete(*strs) -> String (18127.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!(*strs) -> self | nil (6133.0) -
self から strs に含まれる文字を破壊的に取り除きます。
...た場合は nil を返します。
@param strs 削除する文字列を示す文字列 (のリスト)
//emlist[例][ruby]{
str = "123456789"
p str.delete!("2378") #=> "14569"
p str #=> "14569"
str = "123456789"
p str.delete!("2-8", "^4-6") #=> "14569"
p str......#=> "14569"
str = "abc"
p str.delete!("2378") #=> "nil"
p str #=> "abc"
//}
@see String#delete... -
String
# delete _ prefix!(prefix) -> self | nil (6133.0) -
self の先頭から破壊的に prefix を削除します。
...。
@param prefix 先頭から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefix
@see String#delete_suffi......x!
@see String#start_with?... -
String
# delete _ prefix(prefix) -> String (6133.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
...@param prefix 先頭から削除する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_s......uffix
@see String#start_with?... -
String
# delete _ suffix!(suffix) -> self | nil (6133.0) -
self の末尾から破壊的に suffix を削除します。
...@param 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 (6133.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
...@param 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
# end _ with?(*strs) -> bool (20.0) -
self の末尾が strs のいずれかであるとき 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?
@see String#delete_suffix, String#delete_suffix... -
String
# start _ with?(*prefixes) -> bool (20.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...param prefixes パターンを表す文字列または正規表現 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string......".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefix, String#delete_prefix!... -
String
# unpack(template) -> Array (14.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...アンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文......!<: little endian signed long
//}
=== 各テンプレート文字の説明
説明中、Array#pack と String#unpack で違いのあるものは `/' で区切って
「Array#pack の説明 / String#unpack の説明」としています。
: a
ASCII文字列(ヌル文字を詰める/後続する......=> "a\x00b"
[97, 98].pack("Cx3C") # => "a\x00\x00\x00b"
"abc".unpack("CxC") # => [97, 99]
"abc".unpack("Cx3C") # => ArgumentError: x outside of string
//}
: X
1バイト後退
//emlist[][ruby]{
[97, 98, 99].pack("CCXC") # => "ac"
"abcdef".unpack("x*XC") # => [102]
//}
: @
絶対位置......ックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレ...