37件ヒット
[1-37件を表示]
(0.119秒)
検索結果
先頭4件
-
String (44246.0)
-
文字列のクラスです。 ヌル文字を含む任意のバイト列を扱うことができます。 文字列の長さにはメモリ容量以外の制限はありません。
...//emlist[文字列リテラルの例][ruby]{
'str\\ing' # シングルクオート文字列 (エスケープシーケンスがほぼ無効)
"string\n" # ダブルクオート文字列 (エスケープシーケンスがすべて有効)
%q(str\\ing) # 「%q」文字列 (エスケープシーケ......用も可能
<<-End
この行はヒアドキュメント (終端記号をインデントできる)
End
//}
===[a:mutable] 破壊的な変更
Ruby の String クラスは mutable です。
つまり、オブジェクト自体を破壊的に変更できます。
「破壊的な変更」とは......#=> Encoding::CompatibilityError
//}
String#eql? はハッシュのキーの比較に使われますので、
ハッシュのキーに非 ASCII 文字列を使う場合には注意が必要です。
//emlist[動作例: (注)一行目にmagic commentが必要です。][ruby]{
#......ト、ダブルクオートとの併用も可能
<<~End
この行のインデントは無視される
End
//}
===[a:mutable] 破壊的な変更
Ruby の String クラスは mutable です。
つまり、オブジェクト自体を破壊的に変更できます。
「破壊的な変更」とは... -
Gem
:: Package :: TarHeader # magic -> String (24418.0) -
tar のヘッダに含まれる magic を返します。
...tar のヘッダに含まれる magic を返します。... -
NEWS for Ruby 3
. 0 . 0 (750.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...word arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now match......{
0 => a
p a #=> 0
{b: 0, c: 1} => {b:}
p b #=> 0
//}
//emlist{
# version 3.0
0 in 1 #=> false
# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}
* Find-pattern is added. [EXPERIMENTAL]
16828
//emlist{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, String => y......is added. [EXPERIMENTAL]
16746
//emlist{
def square(x) = x * x
//}
* Interpolated String literals are no longer frozen when
`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (600.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...ex q num per and or
plus minus ast slash hat sq
period comma langl rangl eq tilde
dollar at under lbrarbra
lbra2rbra2 lbra3rbra3 dq colon ac
backslash semicolon
===[a:ex] !
: !true
not 演算子。d:spec/operator#notを参照。
:......べてより破壊的な作用をもつメソッド(例: tr と tr!)で使われます。
: /xxx/ !~ yyy
正規表現のメソッド =~ の否定。マッチが失敗したらtrueを返します。
===[a:q] ?
: ?a
d:spec/literal#string。長さ 1 の文字列。
: def xx?
この場合の......書き方。
: #! ruby -Ks
shebang。d:spec/rubycmd#shebangを参照。
: # coding: utf-8
マジックコメント。d:spec/m17n#magic_comment を参照。
: "a is #{a}"
d:spec/literal#exp
//emlist{
a = 10
p "a is #{a}" #=> "a is 10"
//}
: Range#each
説明文の中でのみ使わ...