698件ヒット
[1-100件を表示]
(0.164秒)
ライブラリ
クラス
- 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 (27226.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
# bytesize -> Integer (21319.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
StringIO
# size -> Integer (21202.0) -
文字列の長さを返します。
文字列の長さを返します。 -
Symbol
# size -> Integer (18220.0) -
シンボルに対応する文字列の長さを返します。
...シンボルに対応する文字列の長さを返します。
(self.to_s.length と同じです。)
:foo.length #=> 3
@see String#length, String#size... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (15531.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...イト単位のインデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列ま......たは正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探......//emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex... -
StringScanner
# rest _ size -> Integer (15242.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 (15242.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
# matched _ size -> Integer | nil (15232.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
...//emlist[][ruby]{
require 'strscan'
def run(encode)
utf8 = "\u{308B 3073 3044}" # るびい
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[例][r......uby]{
require 'strscan'
s = StringScanner.new('test string')
s.matched_size # => nil
s.scan(/\w+/) # => "test"
s.matched_size # => 4
s.scan(/\w+/) # => nil
s.matched_size # => nil
//}... -
StringScanner
# matchedsize -> Integer | nil (15229.0) -
StringScanner#matched_size と同じです。
...
StringScanner#matched_size と同じです。
このメソッドは は将来のバージョンで削除される予定です。
代わりに StringScanner#matched_size を使ってください。
@see StringScanner#matched_size... -
String
# each _ grapheme _ cluster {|grapheme _ cluster| block } -> self (15225.0) -
文字列の書記素クラスタに対して繰り返します。
...。
String#each_char と違って、
Unicode Standard Annex #29 (https://unicode.org/reports/tr29/)
で定義された書記素クラスタに対して繰り返します。
//emlist[例][ruby]{
"a\u0300".each_char.to_a.size # => 2
"a\u0300".each_grapheme_cluster.to_a.size # => 1
//}
@see String#g......rapheme_clusters...