るりまサーチ

最速Rubyリファレンスマニュアル検索!
5852件ヒット [201-300件を表示] (0.171秒)

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

クラス

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

String#ascii_only? -> bool (15101.0)

文字列がASCII文字のみで構成されている場合に true を返します。そうでない場合は false を返します。

...ASCII文字のみで構成されている場合に true を返します。そうでない場合は
false を返します。

例:

'abc123'.ascii_only? # => true
''.ascii_only? # => true
'日本語'.ascii_only? # => false
'日本語abc123'.ascii_only? # => false...

Module#const_source_location(name, inherited = true) -> [String, Integer] (12314.0)

name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。

...name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。

@param name Symbol,String で定数の名前を指定します。
@param inherited true を指定するとスーパークラスや include したモジュールで定義され...
...B.const_source_location('C4') # => ["test.rb", 12]
p B.const_source_location('C3') # => ["test.rb", 7]
p B.const_source_location('C1') # => ["test.rb", 2]

p B.const_source_location('C3', false) # => nil -- include したモジュールは検索しない

p A.const_...
...source_location('C2') # => ["test.rb", 16] -- 最後に定義された位置を返す

p Object.const_source_location('B') # => ["test.rb", 10] -- Object はトップレベルの定数を検索する
p Object.const_source_location('A') # => ["test.rb", 1] -- クラスが再定...

Rake::RDocTask#option_string -> String (12303.0)

rdoc コマンドに渡すオプションを文字列として返します。

rdoc コマンドに渡すオプションを文字列として返します。

Gem::Command#get_one_optional_argument -> String (12302.0)

コマンドラインからオプショナルな引数を取得して返します。

コマンドラインからオプショナルな引数を取得して返します。

@return 一つ以上、指定した場合は最初の値を返します。一つも指定していない場合は nil を返します。

JSON::Generator::GeneratorMethods::String#to_json_raw -> String (12224.0)

自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。

...自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。

@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json...

絞り込み条件を変える

Encoding::UndefinedConversionError#destination_encoding_name -> String (12202.0)

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#destination_encoding...

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (12202.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

@param state_or_hash 生成する JSON 形式の文字...
...SON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

puts "test".to_json # => "test"
puts '"'.to_json # => "\""
puts "\\".to_json...
...# => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...

String#concat(*arguments) -> self (12108.0)

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.concat("!", 33, 33)
p str # => "foo!!!"
//}

@see String#append_as_bytes...

String#concat(other) -> self (12108.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"
//}...

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (12107.0)

生の文字列を格納したハッシュを生成します。

...JSON に変換する場合に使用してください。

require 'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json # source sequence is illegal/malformed (JSON::Ge...

絞り込み条件を変える

String#concat(other) -> self (12107.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"
//}...
...追加します。

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"
//}...
<< < 1 2 3 4 5 ... > >>