るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.072秒)

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

REXML::Instruction#target -> String (18214.0)

XML 処理命令のターゲットを返します。

...y]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" href=\"style.css\""...

REXML::Instruction#content -> String | nil (119.0)

XML 処理命令の内容を返します。

...w(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" href=\"style.css\""
doc[4].target # => "foobar"
doc[4].conten...

CSV (114.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...
...ould just
magically work for you data. However, you can set these values manually in
the target Encoding to avoid the translation.

It's also important to note that while all of CSV's core parser is now
Encoding
agnostic, some features are not. For example, the built-in
converters will try to tran...

yaml (54.0)

構造化されたデータを表現するフォーマットであるYAML (YAML Ain't Markup Language) を扱うためのライブラリです。

...uby]{
require 'yaml'
require 'stringio'

strio_r = StringIO.new(<<~YAML_EOT)
---
time: 2008-02-25 17:03:12 +09:00
target
: YAML
version: 4
log: |
例を加えた。
アブストラクトを修正した。
---
time: 2008-02-24 17:00:35 +09:00
target
: YAML
version: 3
log: |...
...|
puts "version %d\ntime %s\ntarget:%s\n%s\n" % obj.values_at("version", "time", "target", "log")
end

# =>
# version 3
# time 2008-02-24 17:00:35 +0900
# target:YAML
# アブストラクトを書いた。
#
# version 4
# time 2008-02-25 17:03:12 +0900
# target:YAML
# 例を加えた。
#...
...ジェクト
* !ruby/range: Range オブジェクト
* !ruby/string: String オブジェクト
* !ruby/struct: Struct オブジェクト
* !ruby/sym(もしくは !ruby/symbol): Symbol オブジェクト
* !ruby/encoding: Encoding オブジェクト
* !ruby/exception: 例外オブジェクト...