るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < ... 3 4 5 >>

String#chop! -> self | nil (7.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...
...った場合は 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!...

String#delete_suffix!(suffix) -> self | nil (7.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 (7.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?...

Zlib::GzipReader#lineno -> Integer (7.0)

IO クラスの同名メソッドIO#linenoと同じです。

...lib::GzipWriter.open('hoge.gz') { |gz|
gz.puts 'h'
gz.puts 'o'
gz.puts 'g'
gz.puts 'e'
}
=end

Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
l.chomp!
printf "%s %d\n", l, gz.lineno
end
}
#=> h 1
#=> o 2
#=> g 3
#=> e 4

@see IO#lineno...

Zlib::GzipReader#lineno=(num) (7.0)

IO クラスの同名メソッドIO#lineno=と同じです。

...gz.puts 'h'
gz.puts 'o'
gz.puts 'g'
gz.puts 'e'
}
=end

Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
l.chomp!
gz.lineno = 1000 if l == "o"
printf "%s %d\n", l, gz.lineno
end
}
#=> h 1
#=> o 1001
#=> g 1002
#=> e 1003

@see IO#lin...

絞り込み条件を変える

<< < ... 3 4 5 >>