るりまサーチ

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

別のキーワード

  1. _builtin bytes
  2. stringio bytes
  3. string bytes
  4. securerandom random_bytes
  5. random bytes

ライブラリ

クラス

検索結果

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

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

...れば127、
それ以上であればstring.bytesizeになります。
@return 引数 string と同じ内容の文字列オブジェクト

//emlist[例][ruby]{
text = "hoge".encode("EUC-JP")
no_option = String.new(text) # => "hoge"
no_option.encod...
...ing == Encoding::EUC_JP # => true
with_encoding = String.new(text, encoding: "UTF-8") # => "hoge"
with_encoding.encoding == Encoding::UTF_8 # => true
String.new("test", encoding: "UTF-8", capacity: 100_000) # => "test"
//}...

WIN32OLE_VARIANT.new(val, vartype = nil) -> WIN32OLE_VARIANT (18138.0)

指定したオブジェクトを値とするWIN32OLE_VARIANTオブジェクトを生成します。

...NilClass のいずれでもありません。

shell = WIN32OLE.new('Shell.Application')
folder = shell.NameSpace('C:\\Users\\Public\\Documents')
item = folder.ParseName('test.txt')
v = WIN32OLE_VARIANT.new('Delete')
item.invokeVerb(v) # => ゴミ箱への移動ダイア...
...ンコーディングをASCII-8BITに設
定した文字列となります。

include WIN32OLE::VARIANT
bytes
= WIN32OLE_VARIANT.new([1,2,3,4,5], VT_UI1 | VT_ARRAY)
bytes
.value #=> "\x01\x02\x03\x04\x05"
bytes
.value.encoding #=> #<Encoding:ASCII-8BIT>

@see WIN32OLE::VARIANT...