種類
- インスタンスメソッド (2404)
- 特異メソッド (43)
ライブラリ
- ビルトイン (2183)
-
bigdecimal
/ util (12) - csv (12)
- kconv (144)
- rake (60)
- scanf (12)
- shellwords (24)
キーワード
- % (12)
- * (12)
- + (12)
- +@ (10)
- -@ (10)
- << (12)
- <=> (12)
- == (12)
- === (12)
- =~ (12)
- [] (72)
- []= (84)
-
ascii
_ only? (12) - b (12)
- byteindex (3)
- byterindex (3)
- bytes (24)
- bytesize (12)
- byteslice (36)
- bytesplice (10)
- capitalize (12)
- capitalize! (12)
- casecmp (12)
- casecmp? (9)
- center (12)
- chars (24)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (12)
- clear (12)
- codepoints (24)
- concat (21)
- count (12)
- crypt (12)
- dedup (3)
- delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) - downcase (12)
- downcase! (12)
- dump (12)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) - empty? (12)
- encode (36)
- encode! (24)
- encoding (12)
-
end
_ with? (12) - eql? (12)
- ext (12)
-
force
_ encoding (12) - getbyte (12)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (12)
- hex (12)
- include? (12)
- index (12)
- insert (12)
- inspect (12)
- intern (12)
- iseuc (12)
- isjis (12)
- issjis (12)
- isutf8 (12)
- kconv (12)
- length (12)
- lines (24)
- ljust (12)
- lstrip (12)
- lstrip! (12)
- match (24)
- match? (9)
- new (31)
- next (12)
- next! (12)
- oct (12)
- ord (12)
-
parse
_ csv (12) - partition (12)
- pathmap (12)
-
pathmap
_ explode (12) -
pathmap
_ partial (12) -
pathmap
_ replace (12) - prepend (21)
- replace (12)
- reverse (12)
- reverse! (12)
- rindex (12)
- rjust (12)
- rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (24)
- scanf (12)
- scrub (36)
- scrub! (36)
- setbyte (12)
- shellescape (12)
- shellsplit (12)
- size (12)
- slice (72)
- slice! (72)
- split (19)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (12) - strip (12)
- strip! (12)
- sub (36)
- sub! (36)
- succ (12)
- succ! (12)
- sum (12)
- swapcase (12)
- swapcase! (12)
-
to
_ c (12) -
to
_ d (12) -
to
_ f (12) -
to
_ i (12) -
to
_ r (12) -
to
_ s (12) -
to
_ str (12) -
to
_ sym (12) - toeuc (12)
- tojis (12)
- tolocale (12)
- tosjis (12)
- toutf16 (12)
- toutf32 (12)
- toutf8 (12)
- tr (12)
- tr! (12)
-
tr
_ s (12) -
tr
_ s! (12) -
try
_ convert (12) - undump (8)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
- unpack1 (9)
- upcase (12)
- upcase! (12)
- upto (12)
-
valid
_ encoding? (12)
検索結果
先頭5件
-
String
# strip -> String (9223.0) -
文字列先頭と末尾の空白文字を全て取り除いた文字列を生成して返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc \r\n".strip #=> "abc"
p "abc\n".strip #=> "abc"
p " abc".strip #=> "abc"
p "abc".strip #=> "abc"
p " \0 abc \0".strip #=> "abc"
str = "\tabc\n"
p str.strip #=> "abc"
p str......#=> "\tabc\n" (元の文字列は変化しない)
//}
@see String#lstrip, String#rstrip... -
String
# lstrip -> String (9217.0) -
文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}
@see String#strip, String#rstrip... -
String
# rstrip -> String (9123.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"
str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n" (......元の文字列は変化しない)
//}
@see String#lstrip,String#strip... -
String
# rstrip! -> self | nil (9123.0) -
文字列の末尾にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...的に取り除きます。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
str = " abc\n"
p str.rstrip! # => " abc"
p str # => " abc"
str = " abc \r\n\t\v\0"
p str.rstrip! # => " abc"
p str # => " abc"
//}
@see String#rstrip, String#lstrip... -
String
# strip! -> self | nil (9123.0) -
先頭と末尾の空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...\t\r\n\f\v\0" です。
strip! は、内容を変更した self を返します。
ただし取り除く空白がなかったときは nil を返します。
//emlist[例][ruby]{
str = " abc\r\n"
p str.strip! #=> "abc"
p str #=> "abc"
str = "abc"
p str.strip! #=> nil
p str......#=> "abc"
str = " \0 abc \0"
str.strip!
p str #=> "abc"
//}
@see String#strip, String#lstrip... -
String
# lstrip! -> self | nil (9117.0) -
文字列の先頭にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...は " \t\r\n\f\v\0" です。
lstrip! は self を変更して返します。
ただし取り除く空白がなかったときは nil を返します。
//emlist[例][ruby]{
str = " abc"
p str.lstrip! # => "abc"
p str # => "abc"
str = "abc"
p str.lstrip! # => nil
p str #... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (9101.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("... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (9101.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...字列のインデックス pos から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定......します。
pos が負の場合は、文字列の末尾から数えた位置から探索します。
rindex と String#index とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始位置を右から......。
//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1)... -
String
# delete _ prefix!(prefix) -> self | nil (6201.0) -
self の先頭から破壊的に prefix を削除します。
...prefix を削除します。
@param prefix 先頭から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefi......x
@see String#delete_suffix!
@see String#start_with?... -
String
# delete _ prefix(prefix) -> String (6201.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
...から prefix を削除した文字列のコピーを返します。
@param prefix 先頭から削除する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("ll......o") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_suffix
@see String#start_with?...