るりまサーチ

最速Rubyリファレンスマニュアル検索!
143件ヒット [1-100件を表示] (0.021秒)
トップページ > クエリ:tr[x] > クエリ:strip[x]

別のキーワード

  1. matrix tr
  2. string tr!
  3. string tr
  4. string tr_s
  5. string tr_s!

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

String#strip -> String (27337.0)

文字列先頭と末尾の空白文字を全て取り除いた文字列を生成して返します。 空白文字の定義は " \t\r\n\f\v\0" です。

....strip #=> "abc"
p "abc\n".strip #=> "abc"
p " abc".strip #=> "abc"
p "abc".strip #=> "abc"
p " \0 abc \0".strip #=> "abc"

str = "\tabc\n"
p str.strip #=> "abc"
p str #=> "\tabc\n" (元の文字列は変化しない)
//}

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

String#lstrip -> String (15306.0)

文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。

...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。

//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}

@see String#strip, String#rstrip...

String#rstrip -> String (15306.0)

文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。

...abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"

str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n" (元の文字列は変化しない)
//}

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

String#strip! -> self | nil (15231.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#lstrip! -> self | nil (15200.0)

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

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

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

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

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

絞り込み条件を変える

String#rstrip! -> self | nil (15200.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...

RDoc::Text#strip_hashes(text) -> String (12301.0)

引数から各行の行頭の # を削除します。

引数から各行の行頭の # を削除します。

@param text 文字列を指定します。

RDoc::Text#strip_newlines(text) -> String (12301.0)

引数から先頭と末尾の改行を削除します。

引数から先頭と末尾の改行を削除します。

@param text 文字列を指定します。

RDoc::Text#strip_stars(text) -> String (12301.0)

引数から /* 〜 */ 形式のコメントを削除します。

引数から /* 〜 */ 形式のコメントを削除します。

@param text 文字列を指定します。
<< 1 2 > >>