るりまサーチ

最速Rubyリファレンスマニュアル検索!
2077件ヒット [701-800件を表示] (0.205秒)

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < ... 6 7 8 9 10 ... > >>

String#toutf32 -> String (18309.0)

self のエンコーディングを UTF-32 に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。

...self のエンコーディングを UTF-32 に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。

このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。...
...これらを変換したくない場合は、 NKF.#nkf('-w32xm0', str)
を使ってください。

@
see Kconv.#toutf32...

String#toutf8 -> String (18309.0)

self のエンコーディングを UTF-8 に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。

...self のエンコーディングを UTF-8 に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。

このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。...
...これらを変換したくない場合は、 NKF.#nkf('-wxm0', str)
を使ってください。

@
see Kconv.#toutf8...

String#match(regexp, pos = 0) -> MatchData | nil (18308.0)

regexp.match(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match を参照してください。

...
r
egexp.match(self, pos) と同じです。
r
egexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match を参照してください。

//emlist[例: regexp のみの場合][ruby]{
'hello'.match('(.)\1') # => #<MatchData "ll" 1:"l">
'hello'.match('(.)\...
...ll"
'hello'.match(/(.)\1/)[0] # => "ll"
'hello'.match('xx') # => nil
//}

//emlist[例: regexp, pos を指定した場合][ruby]{
'hoge hige hege bar'.match('h.ge', 0) # => #<MatchData "hoge">
'hoge hige hege bar'.match('h.ge', 1) # => #<MatchData "hige">
//}

//emlist[例: ブロ...
...ックを指定した場合][ruby]{
'hello'.match('(.)\1'){|e|"match #{$1}"} # => "match l"
'hello'.match('xx'){|e|"match #{$1}"} # マッチしないためブロックは実行されない
//}

@
see Regexp#match, Symbol#match...

String#end_with?(*strs) -> bool (18256.0)

self の末尾が strs のいずれかであるとき true を返します。

...trs のいずれかであるとき true を返します。

@
param strs パターンを表す文字列 (のリスト)

//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}

@
see String#star...
...t_with?...
...t_with?
@
see String#delete_suffix, String#delete_suffix!...

String#to_i(base = 10) -> Integer (18238.0)

文字列を 10 進数表現された整数であると解釈して、整数に変換します。

...ist[例][ruby]{
p " 10".to_i # => 10
p "+10".to_i # => 10
p "-10".to_i # => -10

p "010".to_i # => 10
p "-010".to_i # => -10
//}

整数とみなせない文字があればそこまでを変換対象とします。
変換対象が空文字列であれば 0 を返します。

//emlist[...
...例][ruby]{
p "0x11".to_i # => 0
p "".to_i # => 0
//}

基数を指定することでデフォルトの 10 進以外に 2 〜 36 進数表現へ変換できます。
それぞれ Ruby の整数リテラルで使用可能なプリフィクスは無視されます。
また、base に 0 を指...
...ArgumentError が発生します。

//emlist[例][ruby]{
p "01".to_i(2) # => 1
p "0b1".to_i(2) # => 1

p "07".to_i(8) # => 7
p "0o7".to_i(8) # => 7

p "1f".to_i(16) # => 31
p "0x1f".to_i(16) # => 31

p "0b10".to_i(0) # => 2
p "0o10".to_i(0) # => 8
p "010".to_i(0) # => 8
p "0d10".to...

絞り込み条件を変える

String#oct -> Integer (18232.0)

文字列を 8 進文字列であると解釈して、整数に変換します。

...//emlist[例][ruby]{
p "10".oct # => 8
p "010".oct # => 8
p "8".oct # => 0
//}

oct は文字列の接頭辞 ("0", "0b", "0B", "0x", "0X") に応じて
8 進以外の変換も行います。

//emlist[例][ruby]{
p "0b10".oct # => 2
p "10".oct # => 8
p "010".oct # => 8
p "0x10".oct # => 1...
...//emlist[例][ruby]{
p "-010".oct # => -8
p "-0x10".oct # => -16
p "-0b10".oct # => -2

p "1_0_1x".oct # => 65
//}

@
see String#hex, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float

逆に、数値を文字列に変換するにはKernel.#sprintf,
String
#%, Integer#to_s を...

String#unicode_normalize!(form = :nfc) -> self (18232.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。

...換が行なわれなくても self を返します。

@
param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@
raise Encoding::CompatibilityError self が Unicode 文字列ではない場合...
...に発生します。

//emlist[例][ruby]{
t
ext = "a\u0300"
t
ext.unicode_normalize!(:nfc)
t
ext == "\u00E0" # => true
t
ext.unicode_normalize!(:nfd)
t
ext == "a\u0300" # => true
//}

@
see String#unicode_normalize, String#unicode_normalized?...

String#unicode_normalized?(form = :nfc) -> bool (18232.0)

self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。

...orm で指定された正規化形式で Unicode 正規化された文字列か
どうかを返します。

@
param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@
raise Encoding::CompatibilityError...
...生します。

//emlist[例][ruby]{
"a\u0300".unicode_normalized? # => false
"a\u0300".unicode_normalized?(:nfd) # => true
"\u00E0".unicode_normalized? # => true
"\u00E0".unicode_normalized?(:nfd) # => false
"\xE0".force_encoding('ISO-8859-1').unicode_normalized?...
...# => Encoding::CompatibilityError raised
//}

@
see String#unicode_normalize, String#unicode_normalize!...

String#pathmap_explode -> Array (18230.0)

自身をパスを表す部分ごとに分解して配列にして返します。 String#pathmap で利用される protected メソッドです。

...自身をパスを表す部分ごとに分解して配列にして返します。
String
#pathmap で利用される protected メソッドです。

@
see String#pathmap...

String#delete!(*strs) -> self | nil (18226.0)

self から strs に含まれる文字を破壊的に取り除きます。

...self から strs に含まれる文字を破壊的に取り除きます。

str の形式は tr(1) と同じです。
つまり、「a-c」は a から c を意味し、"^0-9" のように
文字列の先頭が「^」の場合は指定文字以外を意味します。

「-」は文字列の両端...
...れます。

@
return 通常は self を返しますが、何も変更が起こらなかった場合は nil を返します。

@
param strs 削除する文字列を示す文字列 (のリスト)

//emlist[例][ruby]{
str = "123456789"
p str.delete!("2378") #=> "14569"
p str...
...#=> "14569"

str = "123456789"
p str.delete!("2-8", "^4-6") #=> "14569"
p str #=> "14569"

str = "abc"
p str.delete!("2378") #=> "nil"
p str #=> "abc"
//}

@
see String#delete...

絞り込み条件を変える

<< < ... 6 7 8 9 10 ... > >>