るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
15件ヒット [1-15件を表示] (0.039秒)
トップページ > クエリ:String[x] > バージョン:2.3.0[x] > ライブラリ:English[x]

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

検索結果

Kernel$$FIELD_SEPARATOR -> String | nil (313.0)

$; の別名

...$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]...

Kernel$$FS -> String | nil (313.0)

$; の別名

...$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]...

Kernel$$INPUT_RECORD_SEPARATOR -> String | nil (313.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$$OFS -> String | nil (313.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$$ORS -> String | nil (313.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$$OUTPUT_FIELD_SEPARATOR -> String | nil (313.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 (313.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$$RS -> String | nil (313.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$$ARGV -> [String] (310.0)

$* の別名

...$* の別名

require "English"
p $ARGV
# end of sample.rb

ruby sample.rb 31 /home/hoge/fuga.txt
#=> ["31", "/home/hoge/fuga.txt"]...

Kernel$$ERROR_POSITION -> [String] | nil (310.0)

$@ の別名

...$@ の別名

require "English"
class SomethingError < StandardError; end

begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end...

絞り込み条件を変える

Kernel$$LAST_PAREN_MATCH -> String | nil (310.0)

$+ の別名

...$+ の別名

require "English"

r1 = Regexp.compile("<img src=(http:.+?)>")
r2 = Regexp.compile("<a href=(http|ftp).+?>(.+?)</a>")

while line = DATA.gets
[ r1, r2 ].each {|rep|
rep =~ line
p $+
}
end
__END__
<tr> <td><img src=http://localhost/a.jpg></td> <td>ikko...

Kernel$$LAST_READ_LINE -> String | nil (310.0)

$_ の別名

...$_ の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

ruby -rEnglish -ne'p $LAST_READ_LINE' a.txt
#=>
"1 e\n"
"2 f\n"
"3 g\n"
"4 h\n"
"5 i\n"...

Kernel$$MATCH -> String | nil (310.0)

$& の別名

...$& の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/(foo|bar)/ =~ str
p $MATCH #=> "foo"...

Kernel$$POSTMATCH -> String | nil (310.0)

$' の別名

...$' の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/foo/ =~ str
p $POSTMATCH #=> ",bar,hee,hoo"...

Kernel$$PREMATCH -> String | nil (310.0)

$` の別名

...$` の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/foo/ =~ str
p $PREMATCH #=> "hoge,"...

絞り込み条件を変える