るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.040秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.5.0[x] > クエリ:String#delete_prefix[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. service drb::extserv#stop_service
  5. oid= openssl::x509::extension#oid

クラス

検索結果

String#delete_prefix(prefix) -> String (69025.0)

文字列の先頭から prefix を削除した文字列のコピーを返します。

文字列の先頭から prefix を削除した文字列のコピーを返します。

@param 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_prefix!(prefix) -> self | nil (9025.0)

self の先頭から破壊的に prefix を削除します。

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_suffix!
@see String#start_with?

String#start_with?(*prefixes) -> bool (43.0)

self の先頭が prefixes のいずれかであるとき true を返します。

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
"strin...

String#delete_suffix!(suffix) -> self | nil (25.0)

self の末尾から破壊的に suffix を削除します。

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 S...

String#delete_suffix(suffix) -> String (25.0)

文字列の末尾から suffix を削除した文字列のコピーを返します。

文字列の末尾から 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!
...

絞り込み条件を変える