種類
- インスタンスメソッド (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
# codepoints {|codepoint| block } -> self (1.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}
ブロックが指定された場合は String#each_codepoint と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_codepoint... -
String
# concat(*arguments) -> self (1.0) -
self に複数の文字列を破壊的に連結します。
self に複数の文字列を破壊的に連結します。
引数の値が整数である場合は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # => "foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.... -
String
# concat(other) -> self (1.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}... -
String
# count(*chars) -> Integer (1.0) -
chars で指定された文字が文字列 self にいくつあるか数えます。
chars で指定された文字が文字列 self にいくつあるか数えます。
検索する文字を示す引数 chars の形式は tr(1) と同じです。
つまり、「"a-c"」は文字 a から c を意味し、
「"^0-9"」のように文字列の先頭が「^」の場合は
指定文字以外を意味します。
文字「-」は文字列の両端にない場合にだけ範囲指定の意味になります。
同様に、「^」も文字列の先頭にあるときだけ否定の効果を発揮します。
また、「-」「^」「\」は
バックスラッシュ (「\」) によりエスケープできます。
引数を複数指定した場合は、
すべての引数にマッチした文字だけを数えます。
@para... -
String
# crypt(salt) -> String (1.0) -
self と salt から暗号化された文字列を生成して返します。 salt には英数字、ドット (「.」)、スラッシュ (「/」) から構成される、 2 バイト以上の文字列を指定します。
...きです。
他にも 29297 などがあります。
注意:
* Ruby 2.6 から非推奨になったため、引き続き必要な場合は
string-crypt gem の使用を検討してください。
* crypt の処理は crypt(3) の実装に依存しています。
従って、crypt で... -
String
# dedup -> String | self (1.0) -
self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
...されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
//emlist[例][ruby]{
# frozen_string_literal: false
original_text = "text"
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text......# => true
original_text.equal?(frozen_text) # => false
original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => true
//}
@see String#+@... -
String
# delete!(*strs) -> self | nil (1.0) -
self から strs に含まれる文字を破壊的に取り除きます。
....delete!("2378") #=> "14569"
p str #=> "14569"
str = "123456789"
p str.delete!("2-8", "^4-6") #=> "14569"
p str #=> "14569"
str = "abc"
p str.delete!("2378") #=> "nil"
p str #=> "abc"
//}
@see String#delete... -
String
# delete(*strs) -> String (1.0) -
self から strs に含まれる文字を取り除いた文字列を生成して返します。
...合は、
すべての引数にマッチする文字だけが削除されます。
@param strs 削除する文字列を示す文字列 (のリスト)
//emlist[例][ruby]{
p "123456789".delete("2378") #=> "14569"
p "123456789".delete("2-8", "^4-6") #=> "14569"
//}
@see String#delete!... -
String
# delete _ prefix!(prefix) -> self | nil (1.0) -
self の先頭から破壊的に prefix を削除します。
...ら削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefix
@see String#delete_suffix!
@see String#start_with?... -
String
# delete _ prefix(prefix) -> String (1.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
...する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_suffix
@see String#start_with?... -
String
# delete _ suffix!(suffix) -> self | nil (1.0) -
self の末尾から破壊的に suffix を削除します。
...ます。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}
@see String#chomp!
@see String#chop!
@see String#delete_prefix!
@see String#delete_suffix
@see String#end_with?... -
String
# delete _ suffix(suffix) -> String (1.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
...。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}
@see String#chomp
@see String#chop
@see String#delete_prefix
@see String#delete_suffix!
@see String#end_with?...