るりまサーチ

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

別のキーワード

  1. httpstatus rc_see_other
  2. webrick/httpstatus rc_see_other
  3. rc_see_other webrick/httpstatus
  4. rc_see_other webrick::httpstatus

ライブラリ

検索結果

String#strip! -> self | nil (18133.0)

先頭と末尾の空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。

...\t\r\n\f\v\0" です。

strip!
は、内容を変更した self を返します。
ただし取り除く空白がなかったときは nil を返します。

//emlist[例][ruby]{
str = " abc\r\n"
p str.strip! #=> "abc"
p str #=> "abc"

str = "abc"
p str.strip! #=> nil
p str...
...#=> "abc"

str = " \0 abc \0"
str.strip!
p str #=> "abc"
//}

@see String#strip, String#lstrip...

String#rstrip! -> self | nil (6108.0)

文字列の末尾にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。

...的に取り除きます。
空白文字の定義は " \t\r\n\f\v\0" です。

//emlist[例][ruby]{
str = " abc\n"
p str.rstrip! # => " abc"
p str # => " abc"

str = " abc \r\n\t\v\0"
p str.rstrip! # => " abc"
p str # => " abc"
//}

@see String#rstrip, String#lstrip...