4件ヒット
[1-4件を表示]
(0.076秒)
別のキーワード
ライブラリ
- ビルトイン (4)
キーワード
-
delete
_ prefix! (1) -
delete
_ suffix! (1) -
end
_ with? (1) -
start
_ with? (1)
検索結果
先頭4件
-
String
# start _ with?(*prefixes) -> bool (36763.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
..."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#d... -
String
# end _ with?(*strs) -> bool (36727.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
# delete _ prefix!(prefix) -> self | nil (18691.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 _ suffix!(suffix) -> self | nil (18691.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?...