るりまサーチ

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

別のキーワード

  1. _builtin ord
  2. string ord
  3. integer ord
  4. ord
  5. ord _builtin

クラス

キーワード

検索結果

<< 1 2 > >>

Integer#ord -> Integer (18134.0)

自身を返します。

...自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@
see String#ord...

String#ord -> Integer (18128.0)

文字列の最初の文字の文字コードを整数で返します。

...の文字コードを整数で返します。

self が空文字列のときは例外を発生します。

@
return 文字コードを表す整数
@
raise ArgumentError self の長さが 0 のとき発生

//emlist[例][ruby]{
p "a".ord # => 97
//}

@
see Integer#chr, String#chr...

Exception#full_message(highlight: true, order: :bottom) -> String (121.0)

例外の整形された文字列を返します。

...引数 highlight と order は 2.5.1 で追加されました。

@
param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。

@
param order :top か :bottom...
...e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}

@
see Exception.to_tty?...
...よる文字装飾がついています。


@
param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。

@
param order :top か :bottom で指定する必要...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (45.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (45.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (45.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (45.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Integer#chr -> String (33.0)

self を文字コードとして見た時に、引数で与えたエンコーディング encoding に対応する文字を返します。

...//}

@
param encoding エンコーディングを表すオブジェクト。Encoding::UTF_8、'shift_jis' など。
@
return 一文字からなる文字列
@
raise RangeError self を与えられたエンコーディングで正しく解釈できない場合に発生します。
@
see String#ord En...

Integer#chr(encoding) -> String (33.0)

self を文字コードとして見た時に、引数で与えたエンコーディング encoding に対応する文字を返します。

...//}

@
param encoding エンコーディングを表すオブジェクト。Encoding::UTF_8、'shift_jis' など。
@
return 一文字からなる文字列
@
raise RangeError self を与えられたエンコーディングで正しく解釈できない場合に発生します。
@
see String#ord En...

String#chr -> String (15.0)

self の最初の文字だけを含む文字列を返します。

...TDIN.getc が 116 を返すため Integer#chr が呼び出される
$ echo test | ruby -e "p STDIN.getc.chr" # => "t"
# ruby 1.9 系以降では STDIN.getc が "t" を返すため String#chr が呼び出される
$ echo test | ruby -e "p STDIN.getc.chr" # => "t"

@
see String#ord, Integer#chr...

絞り込み条件を変える

<< 1 2 > >>