ライブラリ
- ビルトイン (1084)
- csv (72)
- drb (12)
- etc (24)
- fiddle (12)
-
irb
/ context (12) -
irb
/ extend-command (12) - json (180)
-
minitest
/ unit (1) - mkmf (12)
-
net
/ imap (24) -
net
/ pop (108) -
net
/ smtp (44) - objspace (24)
- open-uri (16)
- openssl (96)
- optparse (156)
- ostruct (24)
- pp (36)
- psych (91)
-
rdoc
/ code _ object (36) -
rdoc
/ known _ classes (12) -
shell
/ filter (6) - stringio (48)
- strscan (48)
-
test
/ unit (1) - tmpdir (24)
- win32ole (360)
-
yaml
/ dbm (72)
クラス
-
ARGF
. class (24) - BasicObject (12)
- CSV (60)
-
DRb
:: DRbObject (12) - Dir (24)
- Enumerator (24)
- IO (72)
-
JSON
:: State (36) - MatchData (12)
- Method (24)
- Module (210)
- NameError (12)
-
Net
:: IMAP (12) -
Net
:: IMAP :: FetchData (12) -
Net
:: POPMail (108) -
Net
:: SMTP (44) - Object (397)
-
OpenSSL
:: ASN1 :: ObjectId (60) -
OpenSSL
:: X509 :: Attribute (12) -
OpenSSL
:: X509 :: Name (24) - OpenStruct (24)
- OptionParser (144)
-
OptionParser
:: ParseError (12) -
Psych
:: ScalarScanner (12) -
RDoc
:: CodeObject (36) - Regexp (12)
-
Shell
:: Filter (6) - String (93)
- StringIO (48)
- StringScanner (48)
- Struct (12)
-
WIN32OLE
_ METHOD (84) -
WIN32OLE
_ PARAM (48) -
WIN32OLE
_ TYPE (96) -
WIN32OLE
_ TYPELIB (60) -
WIN32OLE
_ VARIABLE (48) -
WIN32OLE
_ VARIANT (24) -
YAML
:: DBM (72)
モジュール
- Etc (24)
- Fiddle (12)
-
GC
:: Profiler (12) -
IRB
:: ExtendCommandBundle (12) - JSON (108)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (24) - Kernel (152)
- Marshal (48)
-
MiniTest
:: Assertions (1) - ObjectSpace (24)
- Psych (55)
- RDoc (12)
-
Test
:: Unit (1) - URI (8)
オブジェクト
- main (24)
キーワード
-
$ * (12) -
$ -i (12) -
$ FILENAME (12) -
$ _ (12) - % (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (12)
- === (48)
- =~ (9)
-
BUILD
_ RUBY _ PLATFORM (12) - CSV (12)
- Context (12)
-
DEFAULT
_ OBJECT _ TYPE (12) - Enumerator (12)
- Float (12)
- HeaderConverters (12)
- Id (12)
- Integer (12)
-
KNOWN
_ CLASSES (12) - Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - NoMethodError (12)
-
OBJECT
_ TYPE _ TEMPLATE (12) -
RUBY
_ COPYRIGHT (12) -
RUBY
_ DESCRIPTION (12) -
RUBY
_ ENGINE (12) -
RUBY
_ ENGINE _ VERSION (10) -
RUBY
_ PLATFORM (12) -
RUBY
_ RELEASE _ DATE (12) -
RUBY
_ REVISION (6) -
RUBY
_ VERSION (12) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Rubyの起動 (12)
- Ruby用語集 (12)
-
SC
_ SHARED _ MEMORY _ OBJECTS (12) -
SC
_ TYPED _ MEMORY _ OBJECTS (12) - Version (12)
- [] (24)
- []= (12)
-
_ _ drburi (12) -
_ _ id _ _ (12) -
_ dump (12) - all (36)
-
allocation
_ sourcefile (12) -
arg
_ config (12) - attr (12)
- class (12)
-
class
_ variable _ get (12) -
class
_ variable _ set (12) - clone (12)
- comment (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) -
count
_ objects _ size (12) -
create
_ id (12) -
def
_ extend _ command (12) -
define
_ method (24) -
define
_ singleton _ method (24) -
deprecate
_ constant (12) - dump (60)
-
dump
_ stream (12) - dup (12)
- eql? (12)
-
event
_ interface (12) -
fast
_ generate (12) -
fast
_ unparse (12) -
for
_ fd (12) - format (12)
- freeze (12)
- generate (36)
- getc (12)
- gets (12)
- guid (24)
- hash (12)
- helpfile (24)
- inspect (78)
- instance (24)
-
instance
_ method (12) - invert (12)
-
invoke
_ kind (12) - irb (12)
- itself (12)
-
library
_ name (12) - ln (12)
- load (12)
-
long
_ name (12) - mail (36)
- match (24)
- method (12)
- mktmpdir (24)
-
mu
_ pp (1) - name (60)
-
net
/ smtp (12) - new (36)
-
object
_ nl (12) -
object
_ nl= (12) - oid (24)
-
ole
_ type (36) -
ole
_ type _ detail (12) - on (144)
- open (64)
-
parent
_ file _ name (12) -
parent
_ name (12) - path (12)
- pop (36)
-
pretty
_ generate (12) -
pretty
_ inspect (12) -
pretty
_ print _ inspect (12) -
pretty
_ print _ instance _ variables (12) -
pretty
_ unparse (12) -
private
_ constant (9) - progid (12)
-
psych
_ to _ yaml (12) - public (48)
-
public
_ constant (9) -
public
_ instance _ method (12) -
public
_ method (12) - putc (24)
- rdoc (12)
-
read
_ nonblock (12) - readline (12)
- reject (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) - responses (12)
- restore (12)
- result (12)
-
return
_ type (12) -
return
_ type _ detail (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
safe
_ load (19) -
scan
_ full (12) -
search
_ full (12) - select (24)
-
setup
_ argv (1) - shift (12)
-
short
_ name (12) -
singleton
_ class (12) -
singleton
_ method (12) - sn (12)
- sprintf (12)
- sprintf フォーマット (12)
-
src
_ type (12) - start (32)
- string (12)
- tainted? (6)
- then (14)
-
to
_ a (12) -
to
_ json (12) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ s (108) -
to
_ str (12) -
to
_ yaml (12) - tokenize (12)
-
try
_ convert (12) - unpack1 (9)
- unparse (12)
- value (12)
-
variable
_ kind (12) -
with
_ object (24) -
write
_ nonblock (12) - yaml (12)
-
yield
_ self (16) - このマニュアルのヘルプ (12)
- クラス/メソッドの定義 (12)
検索結果
先頭5件
-
String
. try _ convert(obj) -> String | nil (21145.0) -
obj を String に変換しようと試みます。変換には Object#to_str メソッ ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ た場合は nil が返されます。
...obj を String に変換しようと試みます。変換には Object#to_str メソッ
ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ
た場合は nil が返されます。
@param obj 変換する任意のオブジェクト
@return......変換後の文字列または nil
//emlist[例][ruby]{
String.try_convert("str") # => "str"
String.try_convert(/re/) # => nil
//}... -
String
# eql?(other) -> bool (21120.0) -
文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。
...りません。
つまり、"string".eql?(str) という式を実行した場合には、
str が "string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってくださ......、String#upcase,
String#downcase で大文字小文字を揃えてから比較してください。
Hash クラス内での比較に使われます。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".e......ql?("STRING") # => false
p "string".eql?("") # => false
p "".eql?("string") # => false
p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)
p "string".upcase.eql?("String".upcase) # =>... -
String
# %(args) -> String (21113.0) -
printf と同じ規則に従って args をフォーマットします。
...けが意味を持ちます。
: s
文字列を出力します。
引数が String オブジェクトでなければ to_s メソッドにより文字列化
したものを引数として扱います。
: p
Object#inspect の結果を出力します。
//emlist[][ruby]{
p sprintf("%s", /e+/)... -
String
# unpack1(format) -> object (21107.0) -
formatにしたがって文字列をデコードし、展開された1つ目の値を返します。 unpackは配列を返しますがunpack1は配列の1つ目の要素のみを返します。
...って文字列をデコードし、展開された1つ目の値を返します。
unpackは配列を返しますがunpack1は配列の1つ目の要素のみを返します。
//emlist[例][ruby]{
"ABC".unpack1("C*") # => 65
"ABC".unpack("C*") # => [65, 66, 67]
//}
@see String#unpack, Array#pack... -
String
# match(regexp , pos = 0) {|m| . . . } -> object (21101.0) -
regexp.match(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match を参照してください。
regexp.match(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match を参照してください。
//emlist[例: regexp のみの場合][ruby]{
'hello'.match('(.)\1') # => #<MatchData "ll" 1:"l">
'hello'.match('(.)\1')[0] # => "ll"
'hello'.match(/(.)\1/)[0] # => "ll"
'hello'.match('xx') # => nil
//}
... -
String
# eql?(other) -> bool (21090.0) -
文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。
...りません。
つまり、"string".eql?(str) という式を実行した場合には、
str が "string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってくださ......場合は
String#casecmp? を使ってください。
Hash クラス内での比較に使われます。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".eql?("STRING") # => false
p "string".eql?("")......# => false
p "".eql?("string") # => false
p "string".eql?("str" + "ing") # => true (内容が同じなら true)
p "string".eql?("stringX".chop) # => true (内容が同じなら true)
//}
@see Hash, String#<=>, String#casecmp, String#==... -
String
# ==(other) -> bool (21058.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......st[例][ruby]{
stringlike = Object.new
def stringlike.==(other)
"string" == other
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false
def stringlike.to_str
raise
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
String
# ===(other) -> bool (21058.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......st[例][ruby]{
stringlike = Object.new
def stringlike.==(other)
"string" == other
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false
def stringlike.to_str
raise
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
String
# match(regexp , pos = 0) -> MatchData | nil (21001.0) -
regexp.match(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match を参照してください。
regexp.match(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match を参照してください。
//emlist[例: regexp のみの場合][ruby]{
'hello'.match('(.)\1') # => #<MatchData "ll" 1:"l">
'hello'.match('(.)\1')[0] # => "ll"
'hello'.match(/(.)\1/)[0] # => "ll"
'hello'.match('xx') # => nil
//}
... -
Kernel
. # String(arg) -> String (18236.0) -
引数を文字列(String)に変換した結果を返します。
...引数を文字列(String)に変換した結果を返します。
arg.to_s を呼び出して文字列に変換します。
arg が文字列の場合、何もせず arg を返します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなけ......れば発生します。
//emlist[例][ruby]{
class Foo
def to_s
"hogehoge"
end
end
arg = Foo.new
p String(arg) #=> "hogehoge"
//}
@see Object#to_s,String...