11件ヒット
[1-11件を表示]
(0.048秒)
別のキーワード
クラス
- String (11)
検索結果
-
String
# tr(pattern , replace) -> String (15.0) -
pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。
...号の復号
p "ORYV".tr("A-Z", "D-ZA-C") # => "RUBY"
# 全角英数字といくつかの記号の半角化
email = "ruby−lang@example.com"
p email.tr("0-9a-zA-Z.@−", "0-9a-zA-Z.@-")
# => "ruby-lang@example.com"
//}
@see String#tr!, Strin...