るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel$$FIELD_SEPARATOR -> String | nil (12414.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 (12414.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$$ERROR_POSITION -> [String] | nil (12411.0)

$@ の別名

...
$
@ の別名

require "English"
class SomethingError < StandardError; end

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

Kernel$$LAST_PAREN_MATCH -> String | nil (12411.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...
...u</td> <td><a href=http://localhost/link.html>link</a></td> </tr>
#enf of sample.rb

$
ruby sample.rb
"http://localhost/a.jpg"
"link"...

Kernel$$LAST_READ_LINE -> String | nil (12411.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 (12411.0)

$& の別名

...
$
& の別名

require "English"

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

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

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

$' の別名

...
$
' の別名

require "English"

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

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

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

$` の別名

...
$
` の別名

require "English"

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

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

Kernel$$sitearchdir -> String (12405.0)

サイト固有でかつマシン固有のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/site_ruby/バージョン/arch" です。

...サイト固有でかつマシン固有のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/site_ruby/バージョン/arch" です。...
<< 1 2 3 ... > >>