698件ヒット
[1-100件を表示]
(0.116秒)
ライブラリ
クラス
- Array (21)
-
Fiddle
:: Pointer (24) - GetoptLong (24)
-
Net
:: FTP :: MLSxEntry (10) -
Net
:: IMAP :: ContentDisposition (12) -
Net
:: IMAP :: FetchData (12) - Random (12)
- String (223)
- StringIO (24)
- StringScanner (96)
- Struct (12)
- Symbol (24)
- UnboundMethod (60)
-
Zlib
:: Deflate (12) -
Zlib
:: Inflate (12)
モジュール
-
CGI
:: HtmlExtension (120)
キーワード
- == (12)
- [] (84)
- arity (12)
- attr (12)
- byterindex (3)
- bytes (12)
- bytesize (12)
- clear (12)
- clone (12)
-
each
_ grapheme _ cluster (16) - eql? (12)
- facts (10)
-
file
_ field (24) - get (12)
-
get
_ option (12) - length (36)
-
matched
_ size (12) - matchedsize (12)
- name (12)
- pack (21)
- param (12)
-
password
_ field (24) - peek (12)
- peep (12)
-
rest
_ size (12) - restsize (12)
- rindex (12)
-
scrolling
_ list (24) -
set
_ dictionary (24) - slice (72)
- terminate (12)
-
text
_ field (24) -
to
_ str (24) - unpack (12)
検索結果
先頭5件
-
String
# size -> Integer (24126.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... -
StringIO
# size -> Integer (18102.0) -
文字列の長さを返します。
文字列の長さを返します。 -
Symbol
# size -> Integer (15120.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size... -
String
# bytesize -> Integer (15119.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
StringScanner
# rest _ size -> Integer (9142.0) -
文字列の残りの長さを返します。 stringscanner.rest.size と同じです。
...す。
stringscanner.rest.size と同じです。
StringScanner#restsize は将来のバージョンで削除される予定です。
代わりにStringScanner#rest_size を使ってください。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.rest_size # => 11
p......s.rest.size # => 11
//}... -
StringScanner
# restsize -> Integer (9142.0) -
文字列の残りの長さを返します。 stringscanner.rest.size と同じです。
...す。
stringscanner.rest.size と同じです。
StringScanner#restsize は将来のバージョンで削除される予定です。
代わりにStringScanner#rest_size を使ってください。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.rest_size # => 11
p......s.rest.size # => 11
//}... -
String
# [](nth) -> String | nil (9135.0) -
nth 番目の文字を返します。 nth が負の場合は文字列の末尾から数えます。 つまり、 self.size + nth 番目の文字を返します。
...の末尾から数えます。
つまり、 self.size + nth 番目の文字を返します。
nth が範囲外を指す場合は nil を返します。
@param nth 文字の位置を表す整数
@return 指定した位置の文字を表す String オブジェクト
//emlist[例][ruby]{
p 'bar'[2]... -
String
# slice(nth) -> String | nil (9135.0) -
nth 番目の文字を返します。 nth が負の場合は文字列の末尾から数えます。 つまり、 self.size + nth 番目の文字を返します。
...の末尾から数えます。
つまり、 self.size + nth 番目の文字を返します。
nth が範囲外を指す場合は nil を返します。
@param nth 文字の位置を表す整数
@return 指定した位置の文字を表す String オブジェクト
//emlist[例][ruby]{
p 'bar'[2]... -
StringScanner
# matched _ size -> Integer | nil (9132.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
...びい
s = StringScanner.new(utf8.encode(encode))
s.scan(/#{"\u{308B}".encode(encode)}/)
s.matched_size
end
p run("UTF-8") #=> 3
p run("EUC-JP") #=> 2
p run("Shift_Jis") #=> 2
//}
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.matched_size # => nil
s.s......can(/\w+/) # => "test"
s.matched_size # => 4
s.scan(/\w+/) # => nil
s.matched_size # => nil
//}...