ライブラリ
- ビルトイン (915)
-
cgi
/ core (12) - csv (48)
- json (240)
-
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 (108) - open-uri (24)
- optparse (456)
- pathname (12)
- rake (60)
-
rexml
/ document (48) -
rubygems
/ specification (24) -
rubygems
/ version (24) - socket (24)
- strscan (12)
クラス
- Addrinfo (12)
- Array (36)
- BigDecimal (12)
- Binding (7)
- CGI (12)
-
CSV
:: Table (24) - Class (12)
- Complex (12)
- Date (12)
- DateTime (12)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Exception (80)
-
Gem
:: Specification (24) -
Gem
:: Version (24) -
JSON
:: Parser (12) -
JSON
:: State (108) - MatchData (2)
- Method (12)
- Module (156)
-
Net
:: HTTPResponse (96) - Object (84)
- OptionParser (408)
- Pathname (12)
- Proc (12)
-
REXML
:: Document (24) -
REXML
:: Instruction (24) -
Rake
:: Application (36) -
Rake
:: InvocationChain (12) - Range (12)
- Rational (36)
- Regexp (12)
-
RubyVM
:: InstructionSequence (94) - SignalException (12)
- Socket (12)
- String (204)
- StringScanner (12)
- Struct (12)
-
Thread
:: Backtrace :: Location (72) - Time (36)
- UnboundMethod (24)
モジュール
-
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)
-
Net
:: HTTPHeader (12) -
OpenURI
:: Meta (24) -
OptionParser
:: Arguable (48) -
Rake
:: TaskManager (12)
キーワード
- === (12)
-
absolute
_ path (24) -
arg
_ config (12) -
array
_ nl (12) - autoload (12)
- autoload? (12)
- backtrace (12)
-
base
_ label (24) - binread (12)
- body (12)
- byteindex (3)
- canonname (12)
- capitalize (9)
- capitalize! (9)
- clone (36)
- code (12)
- concat (33)
- connect (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - content (12)
-
content
_ encoding (12) -
content
_ type (24) - convert (12)
- deconstruct (2)
-
default
_ argv (12) -
define
_ singleton _ method (24) -
deprecate
_ constant (12) - disasm (12)
- disassemble (12)
- downcase (9)
- downcase! (9)
- dup (24)
- encode (36)
- encode! (24)
- entity (12)
- environment (12)
-
error
_ bytes (12) -
error
_ char (12) - finish (12)
- header (12)
- help (12)
-
http
_ version (12) - indent (12)
- indent= (12)
-
insert
_ output (12) - inspect (48)
-
json
_ creatable? (12) - label (24)
-
last
_ description (12) -
module
_ function (36) - msg (12)
- name (12)
-
object
_ nl (12) -
object
_ nl= (12) - order (48)
- order! (48)
-
original
_ dir (12) - 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)
- rakefile (12)
-
read
_ body (24) - release (12)
-
remove
_ const (12) - replacement (12)
- replacement= (12)
- rpartition (12)
-
rubygems
_ version (12) -
set
_ backtrace (12) - signm (12)
-
singleton
_ class (12) -
singleton
_ method (12) - source (12)
-
source
_ location (43) - space (12)
- space= (12)
-
space
_ before (12) -
space
_ before= (12) -
stand
_ alone? (12) - strftime (12)
-
summary
_ indent (12) - swapcase (9)
- swapcase! (9)
- target (12)
-
to
_ a (12) -
to
_ binary (10) -
to
_ csv (24) -
to
_ json (228) -
to
_ r (12) -
to
_ ruby (12) -
to
_ s (84) - upcase (9)
- upcase! (9)
- ver (12)
- version (24)
- zone (12)
検索結果
先頭5件
-
String
# partition(sep) -> [String , String , String] (36737.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#split... -
String
# rpartition(sep) -> [String , String , String] (36737.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 (33120.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 (33110.0) -
self に複数の文字列を破壊的に連結します。
...ding です。
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
# upcase(*options) -> String (30417.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 (30405.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] (30381.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,... -
String
# capitalize(*options) -> String (30369.0) -
文字列先頭の文字を大文字に、残りを小文字に変更した文字列を返します。
...ons オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "foobar--".capitalize # => "Foobar--"
p "fooBAR--".capitalize # => "Foobar--"
p "FOOBAR--".capitalize # => "Foobar--"
//}
@see String#capitalize!, String#upcase,
String#downcase, String... -
String
# swapcase(*options) -> String (30369.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
# parse _ csv(**options) -> [String] (30345.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 # =... -
String
# encode(**options) -> String (30337.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...す。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :inva......例外 Encoding::UndefinedConversionError を投げます。(デフォルト)
: :undef => :replace
変換先のエンコーディングにおいて文字が定義されていない場合に、未定義文字を置換文字で置き換えます。
: :replace => string
前述の :invalid => :repla......き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)
# U+00B7 MIDDLE DOT, U+2014 EM DASH は対...