7件ヒット
[1-7件を表示]
(0.078秒)
別のキーワード
検索結果
先頭5件
-
Pathname
# each _ line(*args) {|line| . . . } -> nil (18760.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...t[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line......uire "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }
# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}
//emlist[例 sep を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("tes... -
Pathname
# each _ line(*args) -> Enumerator (18460.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...t[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line......uire "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }
# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}
//emlist[例 sep を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("tes... -
Pathname
# readlines(*args) -> [String] (18370.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# binread(*args) -> String | nil (370.0) -
IO.binread(self.to_s, *args)と同じです。
...じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(20, 10) # => "ne one\nThis is lin... -
Pathname
# binwrite(string , offset=nil) -> Integer (370.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# read(*args) -> String | nil (370.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# write(string , offset=nil , **opts) -> Integer (340.0) -
IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write