るりまサーチ

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

別のキーワード

  1. _builtin chop
  2. kernel chop
  3. string chop
  4. string chop!
  5. _builtin chop!

ライブラリ

クラス

モジュール

検索結果

<< < 1 2 >>

String#delete_suffix!(suffix) -> self | nil (6.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 (6.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#eql?(other) -> bool (6.0)

文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。

...=> false
p "".eql?("string") # => false

p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)

p "string".upcase.eql?("String".upcase) # => true
p "string".downcase.eql?("String".downcase) # =>...
...TRING") # => false
p "string".eql?("") # => false
p "".eql?("string") # => false

p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)
//}

@see Hash, String#<=>, String#casecmp, String#==...
<< < 1 2 >>