クラス
-
ARGF
. class (228) - Array (81)
- BasicObject (12)
- Bignum (6)
- Binding (7)
- Complex (24)
- Data (6)
- Dir (55)
- Encoding (60)
-
Encoding
:: Converter (96) -
Encoding
:: InvalidByteSequenceError (36) -
Encoding
:: UndefinedConversionError (24) - Enumerator (24)
-
Enumerator
:: ArithmeticSequence (7) -
Enumerator
:: Chain (7) - Exception (68)
- FalseClass (24)
- File (24)
-
File
:: Stat (24) - Fixnum (6)
- Float (24)
- Hash (24)
- IO (262)
- Integer (60)
- LoadError (12)
- MatchData (158)
- Method (36)
- Module (532)
- NameError (12)
- NilClass (19)
- Object (187)
- Proc (36)
-
Process
:: Status (24) - Random (12)
- Range (50)
- Rational (24)
- Refinement (4)
- Regexp (84)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (94) - Set (6)
- SignalException (12)
- String (2141)
- Struct (24)
- Symbol (329)
- SyntaxError (3)
- Thread (76)
-
Thread
:: Backtrace :: Location (72) - Time (66)
- TracePoint (31)
- TrueClass (24)
- UnboundMethod (48)
- UncaughtThrowError (11)
キーワード
- % (19)
- * (36)
- + (12)
- +@ (10)
- -@ (10)
- << (12)
- <=> (24)
- == (12)
- === (36)
- =~ (52)
- [] (180)
- []= (84)
-
_ _ id _ _ (12) -
_ dump (12) -
absolute
_ path (24) -
alias
_ method (12) -
append
_ as _ bytes (1) - arity (12)
-
ascii
_ only? (12) - asctime (12)
- attr (24)
-
attr
_ accessor (8) -
attr
_ reader (8) -
attr
_ writer (12) - autoload (12)
- autoload? (12)
- b (12)
- backtrace (24)
-
base
_ label (24) - byteindex (3)
- byterindex (3)
- bytes (36)
- bytesize (12)
- byteslice (36)
- bytesplice (10)
- capitalize (24)
- capitalize! (12)
- captures (12)
- casecmp (24)
- casecmp? (18)
- center (12)
- chars (24)
- children (7)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (36)
-
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) - clear (12)
- clone (12)
- codepoints (24)
- concat (21)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - convert (12)
- count (12)
- crypt (12)
- ctime (12)
- deconstruct (2)
- dedup (3)
-
define
_ method (24) -
define
_ singleton _ method (24) - delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) -
destination
_ encoding _ name (24) - dev (12)
- disasm (12)
- disassemble (12)
- downcase (21)
- downcase! (12)
- dummy? (12)
- dump (12)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) - empty? (12)
- encode (36)
- encode! (24)
- encoding (24)
-
end
_ with? (18) - eql? (12)
-
error
_ bytes (12) -
error
_ char (12) -
eval
_ script (7) - filename (12)
- finish (12)
-
force
_ encoding (12) - ftype (12)
- getbyte (12)
- getc (24)
- gets (72)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (24)
- hex (12)
- id2name (12)
-
import
_ methods (4) - include? (12)
- index (12)
-
inplace
_ mode (12) - insert (12)
-
insert
_ output (12) - inspect (387)
-
instance
_ method (12) - intern (24)
- itself (12)
- join (12)
- label (24)
- length (24)
- lines (24)
- ljust (12)
- lstrip (12)
- lstrip! (12)
- match (36)
- match? (9)
-
method
_ defined? (12) -
module
_ function (36) - name (39)
- name= (10)
-
named
_ captures (12) - names (36)
- next (12)
- next! (12)
- oct (12)
- ord (24)
- pack (21)
- partition (12)
- path (90)
-
post
_ match (12) -
pre
_ match (12) - pread (8)
- prepend (21)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) - protected (24)
-
protected
_ method _ defined? (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) - putback (24)
- pwrite (8)
- read (36)
-
read
_ nonblock (24) -
readagain
_ bytes (12) - readchar (24)
- readline (72)
- readlines (36)
- readpartial (24)
-
remove
_ class _ variable (12) - replace (12)
- replacement (12)
- replacement= (12)
- reverse (12)
- reverse! (12)
- rindex (12)
- rjust (12)
- rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (24)
- scrub (36)
- scrub! (36)
-
set
_ backtrace (12) -
set
_ encoding (72) - setbyte (12)
- signm (12)
-
singleton
_ class (12) -
singleton
_ method (12) - size (24)
- slice (132)
- slice! (72)
- source (12)
-
source
_ location (43) - split (19)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (18) - status (12)
- step (19)
- strftime (12)
- strip (12)
- strip! (12)
- sub (36)
- sub! (36)
- succ (12)
- succ! (12)
- sum (12)
- swapcase (21)
- swapcase! (12)
- sysread (12)
- syswrite (12)
- tainted? (6)
-
thread
_ variable? (12) -
to
_ a (12) -
to
_ binary (10) -
to
_ c (12) -
to
_ f (12) -
to
_ i (12) -
to
_ path (27) -
to
_ r (12) -
to
_ s (355) -
to
_ str (24) -
to
_ sym (24) - tr (12)
- tr! (12)
-
tr
_ s (12) -
tr
_ s! (12) - undump (8)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
- unpack1 (9)
- upcase (21)
- upcase! (12)
- upto (12)
-
valid
_ encoding? (12) -
values
_ at (12) -
with
_ object (24) -
write
_ nonblock (12) -
yield
_ self (16) - zone (12)
検索結果
先頭5件
-
MatchData
# string -> String (24411.0) -
マッチ対象になった文字列の複製を返します。
...マッチ対象になった文字列の複製を返します。
返す文字列はフリーズ(Object#freeze)されています。
//emlist[例][ruby]{
m = /(.)(.)(\d+)(\d)/.match("THX1138.")
m.string # => "THX1138."
//}... -
Encoding
:: InvalidByteSequenceError # destination _ encoding _ name -> String (18404.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::InvalidByteSequenceError#destination_encoding... -
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (18404.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
String
# inspect -> String (18328.0) -
文字列オブジェクトの内容を、出力したときに人間が読みやすいような適当な形式に変換します。 変換された文字列は印字可能な文字のみによって構成されます
...ために用意されています。
永続化などの目的で文字列をダンプしたいときは、
String#dump を使うべきです。
//emlist[例][ruby]{
# p ではないことに注意
puts "string".inspect # => "string"
puts "\t\r\n".inspect # => "\t\r\n"
//}
@see String#dump... -
String
# lines(rs = $ / , chomp: false) -> [String] (18322.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定す......rs を取り除きます。
//emlist[][ruby]{
"hello\nworld\n".lines # => ["hello\n", "world\n"]
"hello\nworld\n".lines(chomp: true) # => ["hello", "world"]
//}
@param rs 行末を示す文字列
@param chomp 分割した各行に対して String#chomp と同等の結果を得......省略した場合は false を指定したとみなされます。
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# lines(rs = $ / ) -> [String] (18316.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定す......(つまり空行で分割します)。
@param rs 行末を示す文字列
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (18233.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...す。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけ......mlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("in......g", -1) # => 9
# ing # インデックス -1 の文字から探索を始める
# ing
# ing # 左にずらしていってここで見つかる
//}
@param pattern 探索する部分文字列または正規表現
@param offset 探索を始めるバイ... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (18227.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定します。
pos が負の場合は、文字列の末尾から数えた位置から探索します。
rindex と String#index とでは、探索方向だけが......。
//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1)......# ing # インデックス -1 の文字から探索を始める
# ing
# ing # 左にずらしていってここで見つかる
//}
@param pattern 探索する部分文字列または正規表現
@param pos 探索を始めるインデックス
//emlis... -
String
# lines(rs = $ / , chomp: false) {|line| . . . } -> self (18222.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定す......rs を取り除きます。
//emlist[][ruby]{
"hello\nworld\n".lines # => ["hello\n", "world\n"]
"hello\nworld\n".lines(chomp: true) # => ["hello", "world"]
//}
@param rs 行末を示す文字列
@param chomp 分割した各行に対して String#chomp と同等の結果を得......省略した場合は false を指定したとみなされます。
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# lines(rs = $ / ) {|line| . . . } -> self (18216.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定す......(つまり空行で分割します)。
@param rs 行末を示す文字列
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# byteindex(pattern , offset = 0) -> Integer | nil (18215.0) -
文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...n を検索し、
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定します。
offset が負の場合、文字列の......ト
@raise IndexError オフセットが文字列の境界以外をさしているときに発生します。
//emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('ooo') # => nil
'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/)......teindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil
'foo'.byteindex('o', 1) # => 1
'foo'.byteindex('o', 2) # => 2
'foo'.byteindex('o', 3) # => nil
'foo'.byteindex('o', -1) # => 2
'foo'.byteindex('o', -2) # => 1
'foo'.byteindex('o', -3) # => 1
'foo'.byteindex('o', -4) # => nil
'あいう'.byteind... -
String
# codepoints -> [Integer] (18215.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...列を返します。(self.each_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...