別のキーワード
クラス
-
ARGF
. class (84) - Array (57)
- BasicObject (12)
- Dir (19)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) - Enumerator (24)
- Exception (32)
- File (16)
- Float (24)
- IO (64)
- Integer (60)
- MatchData (110)
- Method (36)
- Module (456)
- NilClass (7)
- Object (120)
- Proc (12)
- Random (12)
- Range (88)
- Rational (24)
- Regexp (48)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (94) - String (1863)
- Struct (24)
- Symbol (53)
- Thread (10)
-
Thread
:: Backtrace :: Location (72) - Time (12)
- TracePoint (19)
- UnboundMethod (60)
キーワード
- % (26)
- * (36)
- + (12)
- +@ (10)
- -@ (10)
- << (12)
- <=> (24)
- == (24)
- === (36)
- =~ (40)
- [] (132)
- []= (96)
-
_ _ id _ _ (12) -
_ dump (12) -
absolute
_ path (24) -
alias
_ method (12) -
append
_ as _ bytes (1) - attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - autoload (12)
- autoload? (12)
- backtrace (12)
-
base
_ label (24) - byteindex (3)
- byterindex (3)
- bytes (36)
- bytesize (12)
- byteslice (36)
- capitalize (12)
- 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) - clone (12)
- codepoints (24)
- concat (21)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - convert (12)
- count (12)
- cover? (19)
- crypt (12)
- deconstruct (2)
- dedup (3)
- delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) -
deprecate
_ constant (12) - disasm (12)
- disassemble (12)
- downcase (12)
- downcase! (12)
- dump (8)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) - encode (36)
- encode! (24)
- encoding (12)
-
end
_ with? (12) - eql? (24)
-
error
_ bytes (12) -
eval
_ script (7) - finish (12)
-
force
_ encoding (12) - freeze (12)
- getbyte (12)
- getc (12)
- gets (36)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (24)
- hex (12)
- include? (12)
- index (12)
-
inplace
_ mode (12) - insert (12)
-
insert
_ output (12) - inspect (151)
- join (12)
- label (24)
- length (12)
- lines (24)
- ljust (12)
- lstrip (12)
- match (24)
- match? (18)
-
method
_ defined? (12) -
module
_ function (24) - name (17)
- name= (10)
- next! (12)
- oct (12)
- ord (24)
- pack (21)
- partition (12)
- path (44)
-
post
_ match (12) -
pre
_ match (12) - pread (8)
- prepend (21)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) - public (36)
-
public
_ method _ defined? (12) - putback (24)
- pwrite (8)
- read (24)
- readchar (12)
- readlines (36)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ method (12) - replacement (12)
- replacement= (12)
- rindex (12)
- rjust (12)
- rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (24)
- scrub (36)
- scrub! (36)
-
set
_ backtrace (12) - setbyte (12)
- size (12)
- slice (72)
-
source
_ location (36) - split (19)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (18) - step (31)
- strftime (12)
- strip (12)
- strip! (12)
- sub (36)
- sub! (36)
- succ! (12)
- sum (12)
- swapcase (12)
- swapcase! (12)
- syswrite (12)
- then (7)
-
to
_ a (12) -
to
_ binary (10) -
to
_ c (12) -
to
_ f (12) -
to
_ i (12) -
to
_ path (8) -
to
_ r (12) -
to
_ s (120) -
to
_ str (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 (12)
- upcase! (12)
- upto (12)
-
values
_ at (12) -
with
_ object (24) -
yield
_ self (8)
検索結果
先頭5件
-
String
# strip -> String (18356.0) -
文字列先頭と末尾の空白文字を全て取り除いた文字列を生成して返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc \r\n".strip #=> "abc"
p "abc\n".strip #=> "abc"
p " abc".strip #=> "abc"
p "abc".strip #=> "abc"
p " \0 abc \0".strip #=> "abc"
str = "\tabc\n"
p str.strip #=> "abc"
p str......#=> "\tabc\n" (元の文字列は変化しない)
//}
@see String#lstrip, String#rstrip... -
String
# lstrip -> String (18350.0) -
文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}
@see String#strip, String#rstrip... -
String
# -@ -> String | self (18335.0) -
self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
...freeze されている文字列の場合、self を返します。
freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
//emlist[例][ruby]{
# frozen_string_literal: false
original_text = "text"
frozen_text = -original_text
froz......en_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false
original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.......equal?(frozen_text) # => true
//}
@see String#+@... -
String
# +@ -> String | self (18334.0) -
self が freeze されている文字列の場合、元の文字列の複製を返します。 freeze されていない場合は self を返します。
...self が freeze されている文字列の場合、元の文字列の複製を返します。
freeze されていない場合は self を返します。
//emlist[例][ruby]{
# frozen_string_literal: false
original_text = "text"
unfrozen_text = +original_text
unfrozen_text.frozen?......=> false
original_text == unfrozen_text # => true
original_text.equal?(unfrozen_text) # => true
original_text = "text".freeze
unfrozen_text = +original_text
unfrozen_text.frozen? # => false
original_text == unfrozen_text # => true
original_text.equal?(unfrozen_text)......# => false
//}
@see String#-@... -
String
# -@ -> String | self (18334.0) -
self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
...freeze されている文字列の場合、self を返します。
freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。
//emlist[例][ruby]{
# frozen_string_literal: false
original_text = "text"
frozen_text = -original_text
froz......en_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false
original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.......equal?(frozen_text) # => true
//}
@see String#+@... -
String
# rstrip -> String (18256.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"
str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n" (......元の文字列は変化しない)
//}
@see String#lstrip,String#strip... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (18187.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...ンデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現......で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始....../emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (18181.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...字列のインデックス pos から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のインデックスを返します。
見つからなければ 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)... -
String
# rstrip! -> self | nil (18155.0) -
文字列の末尾にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...的に取り除きます。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
str = " abc\n"
p str.rstrip! # => " abc"
p str # => " abc"
str = " abc \r\n\t\v\0"
p str.rstrip! # => " abc"
p str # => " abc"
//}
@see String#rstrip, String#lstrip... -
String
# strip! -> self | nil (18155.0) -
先頭と末尾の空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...\t\r\n\f\v\0" です。
strip! は、内容を変更した self を返します。
ただし取り除く空白がなかったときは nil を返します。
//emlist[例][ruby]{
str = " abc\r\n"
p str.strip! #=> "abc"
p str #=> "abc"
str = "abc"
p str.strip! #=> nil
p str......#=> "abc"
str = " \0 abc \0"
str.strip!
p str #=> "abc"
//}
@see String#strip, String#lstrip... -
String
# partition(sep) -> [String , String , String] (15442.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...