442件ヒット
[401-442件を表示]
(0.067秒)
ライブラリ
- ビルトイン (340)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (30) - zlib (24)
クラス
-
ARGF
. class (27) - IO (189)
- Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (30) - String (100)
-
Zlib
:: GzipReader (24)
モジュール
- Enumerable (24)
検索結果
先頭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...