8件ヒット
[1-8件を表示]
(0.017秒)
ライブラリ
- English (8)
モジュール
- Kernel (8)
キーワード
-
$ DEFAULT _ INPUT (1) -
$ DEFAULT _ OUTPUT (1) -
$ INPUT _ LINE _ NUMBER (1) -
$ INPUT _ RECORD _ SEPARATOR (1) -
$ NR (1) -
$ OUTPUT _ FIELD _ SEPARATOR (1) -
$ OUTPUT _ RECORD _ SEPARATOR (1) -
$ RS (1)
検索結果
先頭5件
-
Kernel
$ $ DEFAULT _ INPUT -> IO (18304.0) -
$< の別名
$< の別名
require "English"
while line = $DEFAULT_INPUT.gets
p line
end
# end of sample.rb
ruby sample.rb < /etc/passwd
# => "hoge:x:500:501::/home/hoge:/bin/bash\n"
... -
Kernel
$ $ DEFAULT _ OUTPUT -> IO (18304.0) -
$> の別名
$> の別名
require "English"
dout = $DEFAULT_OUTPUT.dup
$DEFAULT_OUTPUT.reopen("out.txt", "w")
print "foo"
$DEFAULT_OUTPUT.close
$DEFAULT_OUTPUT = dout
p "bar" # => bar
p File.read("out.txt") #=> foo -
Kernel
$ $ INPUT _ LINE _ NUMBER -> Integer (18304.0) -
$. の別名
$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5 -
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (18304.0) -
$/ の別名
$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo -
Kernel
$ $ OUTPUT _ FIELD _ SEPARATOR -> String | nil (9304.0) -
$, の別名
$, の別名
require "English"
array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo" -
Kernel
$ $ OUTPUT _ RECORD _ SEPARATOR -> String | nil (9304.0) -
$\ の別名
$\ の別名
require "English"
print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb
ruby sample.rb
hoge
huga
fuge
ugo -
Kernel
$ $ NR -> Integer (9004.0) -
$. の別名
$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5 -
Kernel
$ $ RS -> String | nil (9004.0) -
$/ の別名
$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo