るりまサーチ

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

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. inspect? irb::context#inspect_mode=

ライブラリ

クラス

キーワード

検索結果

String#chomp!(rs = $/) -> self | nil (62178.0)

self の末尾から rs で指定する改行コードを取り除きます。 ただし rs が "\n" ($/ のデフォルト値) のときは、 実行環境によらず "\r", "\r\n", "\n" のすべてを改行コードとみなして取り除きます。

...@return chomp! は通常 self を返しますが、取り除く改行がなかった場合は nil を返します。

//emlist[例][ruby]{
buf = "string\n"
buf.chomp! # => nil
p buf # => "string"

$/ = "\n" # デフォルトと同じ
p "foo\r".chomp! # => "foo"
p "foo\r\n".chomp! # =>...
..."foo"
p "foo\n".chomp! # => "foo"
p "foo\n\r".chomp! # => "foo\n"

buf = "string\n"
buf.chomp!(nil) # => nil
p buf # => "string\n"

p "foo\r\n\n".chomp!("") # => "foo"
p "foo\n\r\n".chomp!("") # => "foo"
p "foo\n\r\r".chomp!("") # => nil
//}

@see String#chomp
@see String#chop!...
...\n".chomp! # => "foo"
p "foo\n\r".chomp! # => "foo\n"

buf = "string\n"
buf.chomp!(nil) # => nil
p buf # => "string\n"

p "foo\r\n\n".chomp!("") # => "foo"
p "foo\n\r\n".chomp!("") # => "foo"
p "foo\n\r\r".chomp!("") # => nil
//}

@see String#chomp
@see String#chop!
@see String#de...

ruby 1.9 feature (108.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...け取るようになりました [compat]
: String#unpack("M") で CRLF を単独の LF と同様に無視するようになりました ((<ruby-dev:28601>)) [compat]

* M17N
: 以下、ここでいう「1文字」は 1byte のことです
: String#ord という、1文字の文字列に対...
...されました
: string[integer] が 1文字の String を返すようになりました
: string.slice(integer) が 1文字の String を返すようになりました
: ?c が 1文字の String を返すようになりました
: sprintf の %c が 1文字の String を受け付けるよ...
...なりました
: String#[]= が右辺の整数を受け付けなくなりました
: String#chr という先頭の1文字を返すメソッドが追加されました
: IO#getc が 1文字の String を返すようになりました
#: IO#readchar が 1文字の String を返すようにな...

Shell#echo(*strings) -> Shell::Filter (106.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...クトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|...

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (106.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...クトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|...

Shell::Filter#echo(*strings) -> Shell::Filter (106.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...クトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|...

絞り込み条件を変える