るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle type_size_t

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

StringScanner#string -> String (30469.0)

スキャン対象にしている文字列を返します。

...ist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.string # => "test string"
//}

返り値は freeze されていません。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.string.frozen? # => false
//}

なお、このメソッドは StringSc...
...仕様に依存したコードを書かないようにしましょう。

//emlist[例][ruby]{
require 'strscan'

str = 'test string'
s = StringScanner.new(str)
s.string == str # => true
s.string.eql?(str) # => true (将来は false になる可能性がある)
//}

また、返り値の文字列...
...ないでください。

//emlist[例][ruby]{
require 'strscan'

str = 'test string'
s = StringScanner.new(str)
s.string.replace("0123")
s.scan(/\w+/) # => "0123" (将来は "test" が返る可能性あり)
str # => "0123" (将来は "test string" が返る可能性あり)
//}...

StringIO#string -> String (30409.0)

自身が表す文字列を返します。

...たバッファとして使われている文字列です。
文字列は複製されないことに注意して下さい。

//emlist[例][ruby]{
require "stringio"
sio = StringIO.new
sio << "abc"
s = sio.string
p s #=> "abc"
sio << "xyz"
p s #=> "abcxyz"
//}...

CSV#string -> String (24425.0)

StringIO#string に委譲します。

...
String
IO#string に委譲します。


@see StringIO#string...

MatchData#string -> String (24409.0)

マッチ対象になった文字列の複製を返します。

...マッチ対象になった文字列の複製を返します。

返す文字列はフリーズ(Object#freeze)されています。

//emlist[例][ruby]{
m = /(.)(.)(\d+)(\d)/.match("THX1138.")
m.string # => "THX1138."
//}...

REXML::Comment#string -> String (24404.0)

コメント文字列を返します。

コメント文字列を返します。

絞り込み条件を変える

String#partition(sep) -> [String, String, String] (18516.0)

セパレータ sep が最初に登場する部分で self を 3 つに分割し、 [最初のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。

...@param sep セパレータを表す文字列か正規表現を指定します。

//emlist[例][ruby]{
p "axaxa".partition("x") # => ["a", "x", "axa"]
p "aaaaa".partition("x") # => ["aaaaa", "", ""]
p "aaaaa".partition("") # => ["", "", "aaaaa"]
//}

@see String#rpartition, String#split...

String#rpartition(sep) -> [String, String, String] (18516.0)

セパレータ sep が最後に登場する部分で self を 3 つに分割し、 [最後のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。

...と第 2 要素が空文字列になります。

@param sep セパレータを表す文字列か正規表現を指定します。

//emlist[例][ruby]{
p "axaxa".rpartition("x") # => ["axa", "x", "a"]
p "aaaaa".rpartition("x") # => ["", "", "aaaaa"]
//}

@see String#partition, String#split...

String#lstrip -> String (18336.0)

文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。

...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。

//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}

@see String#strip, String#rstrip...

String#rstrip -> String (18336.0)

文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。

...白文字の定義は " \t\r\n\f\v\0" です。

//emlist[例][ruby]{
p " abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"

str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n"...
...(元の文字列は変化しない)
//}

@see String#lstrip,String#strip...
<< 1 2 3 ... > >>