別のキーワード
ライブラリ
- ビルトイン (800)
-
cgi
/ core (12) - csv (24)
- json (156)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - mkmf (12)
-
net
/ http (24) - optparse (396)
- pathname (12)
- socket (12)
- strscan (12)
クラス
- Array (12)
- BigDecimal (12)
- CGI (12)
- Complex (12)
- Date (12)
- DateTime (12)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) - Exception (44)
-
JSON
:: State (48) - MatchData (2)
- Method (12)
- Module (156)
-
Net
:: HTTPResponse (24) - Object (84)
- OptionParser (348)
- Pathname (12)
- Proc (12)
- Range (12)
- Rational (36)
- Regexp (12)
-
RubyVM
:: InstructionSequence (94) - Socket (12)
- String (204)
- StringScanner (12)
- Struct (12)
-
Thread
:: Backtrace :: Location (72) - Time (24)
- UnboundMethod (12)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (12)
-
OptionParser
:: Arguable (48)
キーワード
- === (12)
-
absolute
_ path (24) -
arg
_ config (12) - autoload (12)
- autoload? (12)
- backtrace (12)
-
base
_ label (24) - binread (12)
- byteindex (3)
- capitalize (9)
- capitalize! (9)
- clone (12)
- concat (33)
- connect (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - convert (12)
- deconstruct (2)
-
default
_ argv (12) -
define
_ singleton _ method (24) -
deprecate
_ constant (12) - disasm (12)
- disassemble (12)
- downcase (9)
- downcase! (9)
- dup (12)
- encode (36)
- encode! (24)
- environment (12)
-
error
_ bytes (12) - finish (12)
- header (12)
- indent= (12)
-
insert
_ output (12) - inspect (36)
- label (24)
-
module
_ function (36) -
object
_ nl= (12) - order (48)
- order! (48)
- parse (24)
- parse! (24)
-
parse
_ csv (12) - partition (12)
- path (24)
- permute (24)
- permute! (24)
-
private
_ constant (12) -
program
_ name (12) -
public
_ constant (12) - putback (24)
-
read
_ body (24) -
remove
_ const (12) - replacement (12)
- replacement= (12)
- rpartition (12)
-
set
_ backtrace (12) -
singleton
_ class (12) -
singleton
_ method (12) -
source
_ location (36) - space= (12)
-
space
_ before= (12) - strftime (12)
-
summary
_ indent (12) - swapcase (9)
- swapcase! (9)
-
to
_ binary (10) -
to
_ csv (12) -
to
_ json (228) -
to
_ r (12) -
to
_ s (24) - upcase (9)
- upcase! (9)
検索結果
先頭5件
-
String
# partition(sep) -> [String , String , String] (36755.0) -
セパレータ sep が最初に登場する部分で self を 3 つに分割し、 [最初のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...。
@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".partition("x") # => ["a", "x", "axa"]
p "aaaaa".partition("x") # => ["aaaaa", "", ""]
p "aaaaa".partition("") # => ["", "", "aaaaa"]
//}
@see String#rpartition, String#spl... -
String
# rpartition(sep) -> [String , String , String] (36755.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
# concat(other) -> self (33134.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
# concat(*arguments) -> self (33124.0) -
self に複数の文字列を破壊的に連結します。
...ncoding です。
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!!!"
//... -
String
# parse _ csv(**options) -> [String] (30471.0) -
CSV.parse_line(self, options) と同様です。
...CSV.parse_line(self, options) と同様です。
1 行の CSV 文字列を、文字列の配列に変換するためのショートカットです。
@param options CSV.new と同様のオプションを指定します。
//emlist[][ruby]{
require "csv"
p "Matz,Ruby\n".parse_csv......# => ["Matz", "Ruby"]
p "Matz|Ruby\r\n".parse_csv(col_sep: '|', row_sep: "\r\n") # => ["Matz", "Ruby"]
//}
Ruby 2.6 (CSV 3.0.2) から、次のオプションが使えるようになりました。
//emlist[][ruby]{
require 'csv'
p "1,,3\n".parse_csv # =......1", NaN, "3"]
//}
Ruby 2.7 (CSV 3.1.2) から、次のオプションが使えるようになりました。
//emlist[][ruby]{
require 'csv'
p "Matz, Ruby\n".parse_csv # => ["Matz", " Ruby"]
p "Matz, Ruby\n".parse_csv(strip: true) # => ["Matz", "Ruby"]
//}
@see CSV.new, CSV.... -
String
# upcase(*options) -> String (30435.0) -
全ての小文字を対応する大文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...のエンコーディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}
@see String#upcase!, String#downcase,
String#swapcase, String#capitalize... -
String
# downcase(*options) -> String (30423.0) -
全ての大文字を対応する小文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...す。
どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
@param options オプションの意味は以下の通りです。
: オプションなし
完全な Unicode ケースマッピングに対応し、ほ......e 正規化 (すなわち String#unicode_normalize) はケース
マッピング操作で必ずしも維持されるとは限りません。
現在 ASCII 以外のケースマッピング/フォールディングは、UTF-8, UTF-16BE/LE,
UTF-32BE/LE, ISO-8859-1~16 の String/Symbol でサポート......されています。
他のエンコーディングもサポートされる予定です。
//emlist[例][ruby]{
p "STRing?".downcase # => "string?"
//}
@see String#downcase!, String#upcase, String#swapcase, String#capitalize... -
String
# parse _ csv(**options) -> [String] (30399.0) -
CSV.parse_line(self, options) と同様です。
...CSV.parse_line(self, options) と同様です。
1 行の CSV 文字列を、文字列の配列に変換するためのショートカットです。
@param options CSV.new と同様のオプションを指定します。
//emlist[][ruby]{
require "csv"
p "Matz,Ruby\n".parse_csv......# => ["Matz", "Ruby"]
p "Matz|Ruby\r\n".parse_csv(col_sep: '|', row_sep: "\r\n") # => ["Matz", "Ruby"]
//}
Ruby 2.6 (CSV 3.0.2) から、次のオプションが使えるようになりました。
//emlist[][ruby]{
require 'csv'
p "1,,3\n".parse_csv # =......> ["1", nil, "3"]
p "1,,3\n".parse_csv(nil_value: Float::NAN) # => ["1", NaN, "3"]
//}
@see CSV.new, CSV.parse_line... -
String
# capitalize(*options) -> String (30387.0) -
文字列先頭の文字を大文字に、残りを小文字に変更した文字列を返します。
...
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "foobar--".capitalize # => "Foobar--"
p "fooBAR--".capitalize # => "Foobar--"
p "FOOBAR--".capitalize # => "Foobar--"
//}
@see String#capitalize!, String#upcase,
String#dow......ncase, String#swapcase... -
String
# swapcase(*options) -> String (30387.0) -
大文字を小文字に、小文字を大文字に変更した文字列を返します。
...した文字列を返します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "ABCxyz".swapcase # => "abcXYZ"
p "Access".swapcase # => "aCCESS"
//}
@see String#swapcase!, String#upcase, String#downcase, String#capitalize... -
String
# encode(**options) -> String (30373.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...ません。
@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換......オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequenceError を投げます。(......例外 Encoding::UndefinedConversionError を投げます。(デフォルト)
: :undef => :replace
変換先のエンコーディングにおいて文字が定義されていない場合に、未定義文字を置換文字で置き換えます。
: :replace => string
前述の :invalid => :repla...