るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub!

クラス

キーワード

検索結果

String#bytesize -> Integer (117346.0)

文字列のバイト長を整数で返します。

文字列のバイト長を整数で返します。

//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}

@see String#size

String#length -> Integer (63091.0)

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

//emlist[例][ruby]{
"test".length # => 4
"test".size # => 4
"テスト".length # => 3
"テスト".size # => 3
"\x80\u3042".length # => 2
"\x80\u3042".size # => 2
//}

@see String#bytesize

String#size -> Integer (63091.0)

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

//emlist[例][ruby]{
"test".length # => 4
"test".size # => 4
"テスト".length # => 3
"テスト".size # => 3
"\x80\u3042".length # => 2
"\x80\u3042".size # => 2
//}

@see String#bytesize

IO#write_nonblock(string, exception: true) -> Integer | :wait_writable (412.0)

IO をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。

IO をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。

write(2) が成功した場合、書き込んだ長さを返します。
EAGAIN, EINTR などは例外 Errno::EXXX として呼出元に報告されます。

書き込んだバイト数(つまり返り値)は String#bytesize の
値より小さい可能性があります。

発生した例外 がErrno::EAGAIN、 Errno::EWOULDBLOCK である場合は、
その例外オブジェクトに IO::WaitWritable が Object#extend
されます。よって IO::Wai...