種類
- インスタンスメソッド (2192)
- 特異メソッド (39)
ライブラリ
- ビルトイン (1988)
-
bigdecimal
/ util (11) - csv (11)
- kconv (132)
- rake (55)
- scanf (12)
- shellwords (22)
キーワード
- % (11)
- * (11)
- + (11)
- +@ (9)
- -@ (9)
- << (11)
- <=> (11)
- == (11)
- === (11)
- =~ (11)
- [] (66)
- []= (77)
-
ascii
_ only? (11) - b (11)
- byteindex (2)
- byterindex (2)
- bytes (22)
- bytesize (11)
- byteslice (33)
- bytesplice (4)
- capitalize (11)
- capitalize! (11)
- casecmp (11)
- casecmp? (8)
- center (11)
- chars (22)
- chomp (11)
- chomp! (11)
- chop (11)
- chop! (11)
- chr (11)
- clear (11)
- codepoints (22)
- concat (19)
- count (11)
- crypt (11)
- dedup (2)
- delete (11)
- delete! (11)
-
delete
_ prefix (7) -
delete
_ prefix! (7) -
delete
_ suffix (7) -
delete
_ suffix! (7) - downcase (11)
- downcase! (11)
- dump (11)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (22) -
each
_ grapheme _ cluster (14) -
each
_ line (22) - empty? (11)
- encode (33)
- encode! (22)
- encoding (11)
-
end
_ with? (11) - eql? (11)
- ext (11)
-
force
_ encoding (11) - getbyte (11)
-
grapheme
_ clusters (14) - gsub (44)
- gsub! (44)
- hash (11)
- hex (11)
- include? (11)
- index (11)
- insert (11)
- inspect (11)
- intern (11)
- iseuc (11)
- isjis (11)
- issjis (11)
- isutf8 (11)
- kconv (11)
- length (11)
- lines (22)
- ljust (11)
- lstrip (11)
- lstrip! (11)
- match (22)
- match? (8)
- new (28)
- next (11)
- next! (11)
- oct (11)
- ord (11)
-
parse
_ csv (11) - partition (11)
- pathmap (11)
-
pathmap
_ explode (11) -
pathmap
_ partial (11) -
pathmap
_ replace (11) - prepend (19)
- replace (11)
- reverse (11)
- reverse! (11)
- rindex (11)
- rjust (11)
- rpartition (11)
- rstrip (11)
- rstrip! (11)
- scan (22)
- scanf (12)
- scrub (33)
- scrub! (33)
- setbyte (11)
- shellescape (11)
- shellsplit (11)
- size (11)
- slice (66)
- slice! (66)
- split (17)
- squeeze (11)
- squeeze! (11)
-
start
_ with? (11) - strip (11)
- strip! (11)
- sub (33)
- sub! (33)
- succ (11)
- succ! (11)
- sum (11)
- swapcase (11)
- swapcase! (11)
-
to
_ c (11) -
to
_ d (11) -
to
_ f (11) -
to
_ i (11) -
to
_ r (11) -
to
_ s (11) -
to
_ str (11) -
to
_ sym (11) - toeuc (11)
- tojis (11)
- tolocale (11)
- tosjis (11)
- toutf16 (11)
- toutf32 (11)
- toutf8 (11)
- tr (11)
- tr! (11)
-
tr
_ s (11) -
tr
_ s! (11) -
try
_ convert (11) - undump (7)
-
unicode
_ normalize (10) -
unicode
_ normalize! (10) -
unicode
_ normalized? (10) - unpack (11)
- unpack1 (8)
- upcase (11)
- upcase! (11)
- upto (11)
-
valid
_ encoding? (11)
検索結果
先頭5件
-
String
# pathmap _ replace(patterns) { . . . } -> String (1.0) -
与えられたパスを前もって置き換えます。
与えられたパスを前もって置き換えます。
@param patterns 'pat1,rep1;pat2,rep2;...' のような形式で置換パターンを指定します。 -
String
# prepend(*arguments) -> String (1.0) -
複数の文字列を先頭に破壊的に追加します。
複数の文字列を先頭に破壊的に追加します。
@param arguments 追加したい文字列を指定します。
//emlist[例][ruby]{
a = "!!!"
a.prepend # => "!!!"
a # => "!!!"
a = "!!!"
a.prepend "hello ", "world" # => "hello world!!!"
a # => "hello world!!!"
//} -
String
# prepend(other _ str) -> String (1.0) -
文字列 other_str を先頭に破壊的に追加します。
文字列 other_str を先頭に破壊的に追加します。
@param other_str 追加したい文字列を指定します。
//emlist[例][ruby]{
a = "world"
a.prepend("hello ") # => "hello world"
a # => "hello world"
//} -
String
# replace(other) -> String (1.0) -
self の内容を other の内容で置き換えます。
self の内容を other の内容で置き換えます。
//emlist[例][ruby]{
str = "foo"
str.replace "bar"
p str # => "bar"
//} -
String
# reverse -> String (1.0) -
文字列を文字単位で左右逆転した文字列を返します。
文字列を文字単位で左右逆転した文字列を返します。
//emlist[例][ruby]{
p "foobar".reverse # => "raboof"
p "".reverse # => ""
//} -
String
# reverse! -> self (1.0) -
文字列を文字単位で左右逆転します。
文字列を文字単位で左右逆転します。
//emlist[例][ruby]{
str = "foobar"
str.reverse!
p str # => "raboof"
//} -
String
# rindex(pattern , pos = self . size) -> Integer | nil (1.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...列または正規表現で指定します。
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", -......ンデックス
//emlist[例][ruby]{
p "astrochemistry".rindex("str") # => 10
p "character".rindex(?c) # => 5
p "regexprindex".rindex(/e.*x/, 2) # => 1
p "foobarfoobar".rindex("bar", 6) # => 3
p "foobarfoobar".rindex("bar", -6) # => 3
//}
@see String#index... -
String
# rjust(width , padding = & # 39; & # 39;) -> String (1.0) -
長さ width の文字列に self を右詰めした文字列を返します。 self の長さが width より長い時には元の文字列の複製を返します。 また、第 2 引数 padding を指定したときは 空白文字の代わりに padding を詰めます。
.../emlist[例][ruby]{
p "foo".rjust(10) # => " foo"
p "foo".rjust(9) # => " foo"
p "foo".rjust(8) # => " foo"
p "foo".rjust(2) # => "foo"
p "foo".rjust(1) # => "foo"
p "foo".rjust(10, "*") # => "*******foo"
//}
@see String#center, String#ljust... -
String
# rpartition(sep) -> [String , String , String] (1.0) -
セパレータ sep が最後に登場する部分で self を 3 つに分割し、 [最後のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...と第 2 要素が空文字列になります。
@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".rpartition("x") # => ["axa", "x", "a"]
p "aaaaa".rpartition("x") # => ["", "", "aaaaa"]
//}
@see String#partition, String#split... -
String
# rstrip -> String (1.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...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...