1875件ヒット
[1101-1200件を表示]
(0.172秒)
キーワード
- % (12)
- * (12)
- + (12)
- +@ (10)
- -@ (10)
- << (12)
- <=> (12)
- == (12)
- === (12)
- =~ (12)
- [] (72)
- []= (84)
-
append
_ as _ bytes (1) - byteindex (3)
- byterindex (3)
- bytes (24)
- bytesize (12)
- byteslice (36)
- capitalize (12)
- capitalize! (12)
- casecmp (12)
- casecmp? (9)
- center (12)
- chars (24)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (12)
- codepoints (24)
- concat (21)
- count (12)
- crypt (12)
- dedup (3)
- delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) - 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? (12)
-
force
_ encoding (12) - getbyte (12)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (12)
- hex (12)
- include? (12)
- index (12)
- insert (12)
- inspect (12)
- length (12)
- lines (24)
- ljust (12)
- lstrip (12)
- match (24)
- match? (9)
- next! (12)
- oct (12)
- ord (12)
-
parse
_ csv (12) - partition (12)
- prepend (21)
- rindex (12)
- rjust (12)
- rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (24)
- scrub (36)
- scrub! (36)
- setbyte (12)
- size (12)
- slice (72)
- split (19)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (12) - strip (12)
- strip! (12)
- sub (36)
- sub! (36)
- succ! (12)
- sum (12)
- swapcase (12)
- swapcase! (12)
-
to
_ c (12) -
to
_ f (12) -
to
_ i (12) -
to
_ r (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)
検索結果
先頭5件
-
String
# ==(other) -> bool (12178.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
stringlike = Object.new
def stringlike.==(other)
"string" == other
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false
def stringlike.to_str
raise
end
p "string".......eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
String
# ===(other) -> bool (12178.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
stringlike = Object.new
def stringlike.==(other)
"string" == other
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false
def stringlike.to_str
raise
end
p "string".......eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
String
# []=(substr , val) (12176.0) -
文字列中の substr に一致する最初の部分文字列を文字列 val で置き換えます。
...ubstr に一致する最初の部分文字列を文字列 val で置き換えます。
@param substr 置き換えたい部分文字列のパターンを示す文字列
@param val 指定範囲の部分文字列と置き換える文字列
@return val を返します。
@raise IndexError......self が部分文字列 substr を含まない場合に発生します。
//emlist[例][ruby]{
buf = "string"
buf["trin"] = "!!"
p buf # => "s!!g"
buf = "string"
buf["nosuchstring"] = "!!" # IndexError
//}... -
String
# []=(regexp , name , val) (12171.0) -
正規表現 regexp の name で指定した名前付きキャプチャにマッチする最初の 部分文字列を文字列 val で置き換えます。
...正規表現 regexp の name で指定した名前付きキャプチャにマッチする最初の
部分文字列を文字列 val で置き換えます。
@param regexp 置き換えたい部分文字列のパターンを示す正規表現
@param name 置き換えたい部分文字列の......示す名前
@param val 指定範囲の部分文字列と置き換えたい文字列
@return val を返します。
@raise IndexError name で指定した名前付きキャプチャが存在しない場合に発
生します。
//emlist[例][ruby]{
s = "FooBar"
s[/(?<foo>[......A-Z]..)(?<bar>[A-Z]..)/, "foo"] = "Baz"
p s # => "BazBar"
//}... -
String
# []=(regexp , nth , val) (12171.0) -
正規表現 regexp の nth 番目の括弧にマッチする 最初の部分文字列を文字列 val で置き換えます。
... regexp の nth 番目の括弧にマッチする
最初の部分文字列を文字列 val で置き換えます。
nth が 0 の場合は、マッチした部分文字列全体を val で置き換えます。
@param regexp 置き換えたい部分文字列のパターンを示す正規表現
@......param nth 置き換えたい部分文字列のパターンを示す正規表現レジスタの番号
@param val 指定範囲の部分文字列と置き換えたい文字列
@return val を返します。
@raise IndexError 正規表現がマッチしなかった場合に発生します......。
//emlist[例][ruby]{
buf = "def exec(cmd)"
buf[/def\s+(\w+)/, 1] = "preprocess"
p buf # => "def preprocess(cmd)"
//}... -
String
# []=(regexp , val) (12171.0) -
正規表現 regexp にマッチした部分文字列全体を val で置き換えます。
...正規表現 regexp にマッチした部分文字列全体を val で置き換えます。
@param regexp 置き換えたい部分文字列のパターンを示す正規表現
@param val 置き換えたい文字列
@return val を返します。
@raise IndexError 正規表現がマッ......チしなかった場合に発生します。
//emlist[例][ruby]{
buf = "string"
buf[/tr../] = "!!"
p buf # => "s!!g"
//}... -
String
# lines(rs = $ / , chomp: false) {|line| . . . } -> self (12163.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定すると行区切りなしとみなします。 rs......chomp に true を指定すると、分割した各行の末尾から 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 と同等の結果を得
る場合は true を、そうでない場合は false で指定します。
省略した場合は false を指定したとみなされます。
ブロックが指定された場合は String#each_line と同じ... -
String
# end _ with?(*strs) -> bool (12162.0) -
self の末尾が strs のいずれかであるとき true を返します。
...trs のいずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#star......t_with?
@see String#delete_suffix, String#delete_suffix!... -
String
# to _ i(base = 10) -> Integer (12162.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
...ruby]{
p " 10".to_i # => 10
p "+10".to_i # => 10
p "-10".to_i # => -10
p "010".to_i # => 10
p "-010".to_i # => -10
//}
整数とみなせない文字があればそこまでを変換対象とします。
変換対象が空文字列であれば 0 を返します。
//emlist[例][ruby......".to_i # => 0
//}
基数を指定することでデフォルトの 10 進以外に 2 〜 36 進数表現へ変換できます。
それぞれ Ruby の整数リテラルで使用可能なプリフィクスは無視されます。
また、base に 0 を指定するとプリフィクスから......)、0o (8 進数)、0d (10 進数)、0x (16 進数) です。
0, 2 〜 36 以外の引数を指定した場合は
例外 ArgumentError が発生します。
//emlist[例][ruby]{
p "01".to_i(2) # => 1
p "0b1".to_i(2) # => 1
p "07".to_i(8) # => 7
p "0o7".to_i(8) # => 7
p "1f".to_i(16)...