るりまサーチ

最速Rubyリファレンスマニュアル検索!
116件ヒット [101-116件を表示] (0.141秒)

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. openssl utf8string

ライブラリ

キーワード

検索結果

<< < 1 2 >>

String#end_with?(*strs) -> bool (30092.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#chop! -> self | nil (30086.0)

文字列の最後の文字を取り除きます。 ただし、終端が "\r\n" であればその 2 文字を取り除きます。

...った場合は nil を返します。

//emlist[例][ruby]{
str = "string\r\n"
ret = str.chop!
ret # => "string"
str # => "string"
str.chop! # => "strin"
"".chop! # => nil
//}

@see String#chomp!
@see String#chop
@see String#delete_suffix!...
<< < 1 2 >>