るりまサーチ

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

別のキーワード

  1. string encode
  2. _builtin encode
  3. string encode!
  4. base64 encode64
  5. _builtin encode!

検索結果

<< < ... 2 3 4 >>

String#each_codepoint -> Enumerator (8.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

String#each_codepoint {|codepoint| block } -> self (8.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

String#encoding -> Encoding (8.0)

文字列のエンコーディング情報を表現した Encoding オブジェクトを返します。

...列のエンコーディング情報を表現した Encoding オブジェクトを返します。

//emlist[例][ruby]{
# encoding: utf-8
utf8_str = "test"
euc_str = utf8_str.encode("EUC-JP")
utf8_str.encoding # => #<Encoding:UTF-8>
euc_str.encoding # => #<Encoding:EUC-JP>
//}

@see Encoding...

String.new(string = "") -> String (8.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...す。

@param string 文字列
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
/...
...ing::ASCII_8BITになります)。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true...
...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w...

String.new(string = "", encoding: string.encoding) -> String (8.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...ing::ASCII_8BITになります)。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true...

絞り込み条件を変える

String.new(string = "", encoding: string.encoding, capacity: 127) -> String (8.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w...

String.new(string = "", encoding: string.encoding, capacity: 63) -> String (8.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w...

String.new(string = "", encoding: string.encoding, capacity: string.bytesize) -> String (8.0)

string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。

...string.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encoding == Encoding::EUC_JP # => true
w...

Symbol#casecmp(other) -> -1 | 0 | 1 | nil (8.0)

Symbol#<=> と同様にシンボルに対応する文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。

...ボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。

//emlist[][ruby]{
:foo.casecmp("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8859-1").to_sym.casecmp(:"\u{c4 d6 dc}") #=> nil
//}

@see String#casecmp, Symbol#<=>, Symbol#casecmp?...

Symbol#casecmp?(other) -> bool | nil (8.0)

大文字小文字の違いを無視しシンボルを比較します。 シンボルが一致する場合には true を返し、一致しない場合には false を返します。

...er がシンボルではない場合や、文字列のエンコーディングが非互換の場合は、nil を返します。

//emlist[][ruby]{
:foo.casecmp?("foo") #=> nil
"\u{e4 f6 fc}".encode("ISO-8859-1").to_sym.casecmp?(:"\u{c4 d6 dc}") #=> nil
//}

@see String#casecmp?, Symbol#casecmp...

絞り込み条件を変える

<< < ... 2 3 4 >>