75件ヒット
[1-75件を表示]
(0.075秒)
クラス
-
Encoding
:: Converter (24) - Random (12)
- String (15)
- StringScanner (24)
キーワード
- byterindex (3)
- bytesize (12)
- peek (12)
- peep (12)
-
primitive
_ convert (24)
検索結果
先頭5件
- Random
# bytes(size) -> String - String
# bytesize -> Integer - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol - String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil
-
Random
# bytes(size) -> String (18221.0) -
ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
...ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
@param size 結果の文字列のサイズをバイト数で指定します。
//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}......ムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。
@param size 結果の文字列のサイズをバイト数で指定します。
//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}
@see Random.bytes... -
String
# bytesize -> Integer (12213.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (201.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...on_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (201.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...on_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (201.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始位置を右から左にずらしながら行いますが、
部分文字列の照合はどちらのメソッ... -
StringScanner
# peek(bytes) -> String (149.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...スキャンポインタから長さ bytes バイト分だけ文字列を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScan......わりに StringScanner#peek を使ってください。
@param bytes 0 以上の整数を指定します。
ただし、スキャン対象の文字列の長さを超える分は無視されます。
bytes が 0 のとき、またはスキャンポインタが文字列の......ror bytes に負数を与えると発生します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.peek(0) # => ""
begin
s.peek(-1)
rescue ArgumentError => err
puts err # negative string size (... -
StringScanner
# peep(bytes) -> String (149.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...スキャンポインタから長さ bytes バイト分だけ文字列を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScan......わりに StringScanner#peek を使ってください。
@param bytes 0 以上の整数を指定します。
ただし、スキャン対象の文字列の長さを超える分は無視されます。
bytes が 0 のとき、またはスキャンポインタが文字列の......ror bytes に負数を与えると発生します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.peek(0) # => ""
begin
s.peek(-1)
rescue ArgumentError => err
puts err # negative string size (...