るりまサーチ

最速Rubyリファレンスマニュアル検索!
647件ヒット [1-100件を表示] (0.132秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dh p
  5. rsa p

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

String#codepoints {|codepoint| block } -> self (12402.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

..._codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [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#each_codepoint {|codepoint| block } -> self (12402.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

String#delete_prefix!(prefix) -> self | nil (12302.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 (12302.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?...

String#dump -> String (12208.0)

文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。

...に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。

//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
p
uts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x00\b10\\\""
//}...
...文字列を返します。
str == eval(str.dump) となることが保証されています。

//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
p
uts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\x00\b10\\\""
//}

@see String#undump...

絞り込み条件を変える

String#codepoints -> [Integer] (12202.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

..._codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [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#each_codepoint -> Enumerator (12202.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

String#pathmap_explode -> Array (12202.0)

自身をパスを表す部分ごとに分解して配列にして返します。 String#pathmap で利用される protected メソッドです。

...自身をパスを表す部分ごとに分解して配列にして返します。
String
#pathmap で利用される protected メソッドです。

@see String#pathmap...

String#prepend(*arguments) -> String (12202.0)

複数の文字列を先頭に破壊的に追加します。

...列を先頭に破壊的に追加します。

@param arguments 追加したい文字列を指定します。

//emlist[例][ruby]{
a = "!!!"
a.prepend # => "!!!"
a # => "!!!"

a = "!!!"
a.prepend "hello ", "world" # => "hello world!!!"
a # => "hello world!!!"
//}...

String#prepend(other_str) -> String (12202.0)

文字列 other_str を先頭に破壊的に追加します。

...文字列 other_str を先頭に破壊的に追加します。

@param other_str 追加したい文字列を指定します。

//emlist[例][ruby]{
a = "world"
a.prepend("hello ") # => "hello world"
a # => "hello world"
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>