176件ヒット
[1-100件を表示]
(0.130秒)
ライブラリ
- ビルトイン (110)
- fiddle (22)
- ipaddr (11)
- pathname (11)
-
racc
/ parser (11) -
rexml
/ document (11)
クラス
- Array (33)
-
Fiddle
:: Pointer (22) - IPAddr (11)
- Object (22)
-
REXML
:: Attribute (11) -
Racc
:: Parser (11) - String (55)
モジュール
- Kernel (11)
検索結果
先頭5件
-
Object
# to _ str -> String (18108.0) -
オブジェクトの String への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...面で代置可能であるような、
* 文字列そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_str
'Edition'
end
end
it = Foo.new
p('Second' + it) #=> "SecondEdition"
//}
@see Object#to_s,Kernel.#String... -
Fiddle
:: Pointer # to _ str -> String (18103.0) -
自身が指す領域から長さ len の文字列を複製して返します。
自身が指す領域から長さ len の文字列を複製して返します。
len を省略した場合は、self.size をその代わりに使います。
@param len 文字列の長さを整数で指定します。 -
Fiddle
:: Pointer # to _ str(len) -> String (18103.0) -
自身が指す領域から長さ len の文字列を複製して返します。
自身が指す領域から長さ len の文字列を複製して返します。
len を省略した場合は、self.size をその代わりに使います。
@param len 文字列の長さを整数で指定します。 -
String
# to _ str -> String (15108.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
p "str".to_s # => "str"
p "str".to_str # => "str"
//}
このメソッドは、文字列を他のクラスのインスタンスと混ぜて処理したいときに有効です。
例えば返り値が文字列か nil であるメソッド some_met... -
Racc
:: Parser # token _ to _ str(t) (6102.0) -
@todo
@todo -
IPAddr
# to _ string -> String (6101.0) -
標準的な文字列表現に変換します。
...標準的な文字列表現に変換します。
require 'ipaddr'
addr6 = IPAddr.new('::1')
addr6.to_s #=> "::1"
addr6.to_string #=> "0000:0000:0000:0000:0000:0000:0000:0001"
@see IPAddr#to_s... -
REXML
:: Attribute # to _ string -> String (6101.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
Array
# join(sep = $ , ) -> String (19.0) -
配列の要素を文字列 sep を間に挟んで連結した文字列を返します。
...配列の要素を文字列 sep を間に挟んで連結した文字列を返します。
文字列でない要素に対しては、to_str があれば to_str、なければ to_s した結果を連結します。
要素がまた配列であれば再帰的に (同じ sep を利用して)
join し......字列を指定します。nil のときは空文字列を使います。
文字列以外のオブジェクトを指定した場合は to_str メソッドによ
る暗黙の型変換を試みます。
@raise TypeError 引数に文字列以外の(暗黙の型変換が行えな... -
String
# ==(other) -> bool (19.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...l? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false を返します。
@param other 任......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 (19.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...l? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false を返します。
@param other 任......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?...