るりまサーチ

最速Rubyリファレンスマニュアル検索!
462件ヒット [201-300件を表示] (0.085秒)
トップページ > クエリ:string[x] > 種類:クラス[x]

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 5 > >>

StringScanner::Error (3001.0)

スキャン中に発生したエラーをあらわす例外です。

スキャン中に発生したエラーをあらわす例外です。

CSV (49.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...込み
csv_string = CSV.generate do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end
//}

=== 一行変換

//emlist[][ruby]{
require 'csv'

csv_string = ["CSV", "data"].to_csv # => "CSV,data"
csv_array = "CSV,String".parse_csv # => ["CSV", "String"]
//}

===...
...%w{my data here} } # to a String
CSV($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
//}

=== CSV と文字エンコーディング (M17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or...
...scoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
Encoding of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of c...

REXML::Comment (19.0)

XML コメントを表すクラス。

...コメントとは <!-- と --> で挟まれたテキストです。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!-- xx -->
<root>
<!-- yy -->
text
<!-- zz -->
</root>
EOS

doc[0].string # => " xx "
doc.root[1].string # => " yy "
doc.root[3].string # => " zz "
//}...

REXML::Formatters::Default (19.0)

XMLドキュメントを(文字列として)出力するクラスです。

...tters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren/>\n</children>\n</root>\n"

output = StringIO.new
default_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children>\n <grand...
...children/>\n</children>"

ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_hack_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"
//}...

REXML::Formatters::Transitive (19.0)

XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。

...sitive_formatter = REXML::Formatters::Transitive.new
output = StringIO.new
transitive_formatter.write(doc, output)
output.string
# => "<root\n><children\n >\n<grandchildren foo='bar'\n />\n</children\n ></root\n>\n"
print output.string
# >> <root
# >> ><children
# >> >
# >> <grandchildren foo...
...='bar'
# >> />
# >> </children
# >> ></root
# >> >

output = StringIO.new
transitive_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children\n>\n<grandchildren foo='bar'\n />\n</children\n>"
//}...

絞り込み条件を変える

Symbol (19.0)

シンボルを表すクラス。シンボルは任意の文字列と一対一に対応するオブジェクトです。

...きません(そうでなければ文法エラーになります)。
そうでない文字列をシンボルにしたい場合は残りの表記か String#intern を使用してください。

=== シンボルの実装と用途
==== 実装
Rubyの内部実装では、メソッド名や変数名、...
...ンボルの代わりに文字列を引数として渡すこともできるようになっています。

Symbol クラスのメソッドには、String クラスのメソッドと同名で似た働きをするものもあります。

==== GC

内部的にシンボルは

* シンボルの情報...
...します。

例えば web アプリケーションのようなプロセスを動かしつづけるような
アプリケーションにおいて、ユーザからの入力を String#intern で
シンボルに変換するような実装をすると、DoSに弱くなる可能性があります。...

Rinda::Template (13.0)

タプルのマッチングのためのクラスです。 ユーザがこのクラスを直接使うことはありません。

...te.new(['abc', nil, nil])
template.match(['abc', 2, 5]) # => true
template.match(['hoge', 2, 5]) # => false

template = Rinda::Template.new([String, Integer, nil])
template.match(['abc', 2, 5]) # => true
template.match(['abcd', 2, 5]) # => true

template = Rinda::Template.new([/^abc/, I...
...template.match(['abc', 2, 5]) # => true
template.match(['def', 2, 5]) # => false

template = Rinda::Template.new({'name' => String, 'age' => Integer})
template.match({'name' => 'seki', 'age' => 0x20}) # => true
template.match({'name' => :seki, 'age' => 0x20}) # => fals...

Symbol (13.0)

シンボルを表すクラス。シンボルは任意の文字列と一対一に対応するオブジェクトです。

...きません(そうでなければ文法エラーになります)。
そうでない文字列をシンボルにしたい場合は残りの表記か String#intern を使用してください。

=== シンボルの実装と用途
==== 実装
Rubyの内部実装では、メソッド名や変数名、...
...ンボルの代わりに文字列を引数として渡すこともできるようになっています。

Symbol クラスのメソッドには、String クラスのメソッドと同名で似た働きをするものもあります。

==== GC

内部的にシンボルは

* シンボルの情報...

CGI::Cookie (7.0)

クッキーを表すクラスです。

...nal
'httponly' => true # optional
})

cgi.out({"cookie" => [cookie1, cookie2]}){ "string" }

name = cookie1.name
values = cookie1.value
path = cookie1.path
domain = cookie1.domain
expires = cookie1.expires...

Complex (7.0)

複素数を扱うクラスです。

...数を扱うクラスです。

Complex オブジェクトを作成するには、Kernel.#Complex、
Complex.rect、Complex.polar、Numeric#to_c、
String
#to_c のいずれかを使用します。

//emlist[Complex オブジェクトの作り方][ruby]{
Complex(1) # => (1+0i)
Complex(2, 3)...

絞り込み条件を変える

<< < 1 2 3 4 5 > >>