別のキーワード
種類
- インスタンスメソッド (83)
- 文書 (28)
ライブラリ
- ビルトイン (83)
モジュール
- Enumerable (11)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - capitalize (8)
- capitalize! (8)
- chunk (11)
- downcase (8)
- downcase! (8)
-
ruby 1
. 6 feature (11) - swapcase (8)
- swapcase! (8)
- upcase! (8)
検索結果
先頭5件
-
Symbol
# upcase(*options) -> Symbol (18319.0) -
小文字を大文字に変換したシンボルを返します。
...小文字を大文字に変換したシンボルを返します。
(self.to_s.upcase.intern と同じです。)
:foo.upcase #=> :FOO
@see String#upcase... -
String
# upcase(*options) -> String (18313.0) -
全ての小文字を対応する大文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...のエンコーディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}
@see String#upcase!, String#downcase,
String#swapcase, String#capitalize... -
String
# upcase!(*options) -> self | nil (6313.0) -
全ての小文字を対応する大文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...ンコーディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
buf = "stRIng? STring."
buf.upcase!
p buf # => "STRING? STRING."
//}
@see String#upcase, String#downcase!,
String#swapcase!, String#capi... -
ruby 1
. 6 feature (5352.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...sion 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-snapshot
: 2003-0......1-22: errno
EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていました。現在は、このようなシステムでは、EWOULDBLOCK は、EAGAIN
として定義されています。(これは 1.6.7 とは異なる挙動です)
p Errno:.......6.7 (2002-03-01) [i586-linux]
[]
=> ruby 1.6.7 (2002-08-01) [i586-linux]
["bar"]
: 2002-06-13 Hash[]
Hash[] で、キーとなる文字列を dup & freeze していませんでした。
a = "key"
h = Hash[a,"val"]
h.keys[0].upcase!... -
NEWS for Ruby 3
. 0 . 0 (372.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ated 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 matches the behavior of Procs......}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern mat......* String#upcase
* Symbol
* Symbol#to_proc now returns a lambda Proc. 16260
* Symbol#name has been added, which returns the name of the symbol if it is named. The returned string is frozen. 16150
* Fiber
* Introduce Fiber.set_scheduler for intercepting blocking operations and Fib... -
NEWS for Ruby 2
. 7 . 0 (360.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマ......_VERSION
when ..."2.4" then puts "EOL"
# ...
end
age.clamp(..100)
where(sales: ..100)
//}
* 「$;」にnil以外の値を設定すると警告が出るようになりました。 14240
nil以外の時はString#splitで参照した時も警告が出ます。
この警告は「-W:no-depre......sequence of dates
dates.detect(&:tuesday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
p e.class #=> Enumerator
p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
//}
//emlist[Enumerator:... -
String
# downcase(*options) -> String (260.0) -
全ての大文字を対応する小文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...@param options オプションの意味は以下の通りです。
: オプションなし
完全な Unicode ケースマッピングに対応し、ほとんどの言語に適しています。(例外は以下の :turkic,
:lithuanian オプションを参照)
Unicode 標準の表 3-14 で説......る、コンテキスト依存のケースマッピングは、現在サポートされていません。
: :ascii
ASCII の範囲内のみ (A-Z, a-z) が影響します。
このオプションは他のオプションと組み合わせることはできません。
: :turkic
チュルク語.......upcase.downcase)。
そして、Unicode 正規化 (すなわち String#unicode_normalize) はケース
マッピング操作で必ずしも維持されるとは限りません。
現在 ASCII 以外のケースマッピング/フォールディングは、UTF-8, UTF-16BE/LE,
UTF-32BE/LE, ISO-8859-... -
String
# capitalize!(*options) -> self | nil (206.0) -
文字列先頭の文字を大文字に、残りを小文字に破壊的に変更します。
...文字列先頭の文字を大文字に、残りを小文字に破壊的に変更します。
@param options オプションの詳細は String#downcase を参照してください。
@return capitalize! は self を変更して返しますが、
変更が起こらなかった場合は ni......l を返します。
//emlist[例][ruby]{
str = "foobar"
str.capitalize!
p str # => "Foobar"
str = "fooBAR"
str.capitalize!
p str # => "Foobar"
//}
@see String#capitalize, String#upcase!,
String#downcase!, String#swapcase!... -
String
# capitalize(*options) -> String (206.0) -
文字列先頭の文字を大文字に、残りを小文字に変更した文字列を返します。
...。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "foobar--".capitalize # => "Foobar--"
p "fooBAR--".capitalize # => "Foobar--"
p "FOOBAR--".capitalize # => "Foobar--"
//}
@see String#capitalize!, String#upcase,
String#... -
String
# downcase!(*options) -> self | nil (206.0) -
全ての大文字を対応する小文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...options オプションの詳細は String#downcase を参照してください。
@return self を変更して返します。変更が無かった場合は nil を返します。
//emlist[例][ruby]{
str = "STRing?"
str.downcase!
p str # => "string?"
//}
@see String#downcase, String#upcase!, S... -
String
# swapcase!(*options) -> self | nil (206.0) -
大文字を小文字に、小文字を大文字に破壊的に変更します。
...大文字を小文字に、小文字を大文字に破壊的に変更します。
@param options オプションの詳細は String#downcase を参照してください。
swapcase! は self を変更して返しますが、
置換が起こらなかった場合は nil を返します。
この......メソッドはマルチバイト文字を認識しません。
//emlist[例][ruby]{
str = "ABCxyz"
str.swapcase!
p str # => "abcXYZ"
//}
@see String#swapcase, String#upcase!, String#downcase!, String#capitalize!... -
String
# swapcase(*options) -> String (206.0) -
大文字を小文字に、小文字を大文字に変更した文字列を返します。
...した文字列を返します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "ABCxyz".swapcase # => "abcXYZ"
p "Access".swapcase # => "aCCESS"
//}
@see String#swapcase!, String#upcase, String#downcase, String#capitalize... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (178.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...文字の違いを無視するため upcase しています。
//emlist[例][ruby]{
# ファイルのエンコーディングは実際のファイルに合わせてください。
open("/usr/share/dict/words", "r:iso-8859-1") {|f|
f.chunk {|line| line[0].upcase }.each {|ch, lines| p [ch, lines.le......い場合を考えます。
//emlist[例][ruby]{
sep = "-"*72 + "\n" # ハイフンが72個の行
IO.popen("svn log README") {|f|
f.chunk {|line|
line != sep || nil
}.each {|_, lines|
pp lines
}
}
#=> ["r20018 | knu | 2008-10-29 13:20:42 +0900 (Wed, 29 Oct 2008) | 2 lines\n",
# "\n......",
# "* README, README.ja: Update the portability section.\n",
# "\n"]
# ["r16725 | knu | 2008-05-31 23:34:23 +0900 (Sat, 31 May 2008) | 2 lines\n",
# "\n",
# "* README, README.ja: Add a note about default C flags.\n",
# "\n"]
# ...
//}
テキストを空行で区切られた段...