るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.154秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:get_text[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. bigdecimal to_r
  5. fileutils cp_r

ライブラリ

クラス

キーワード

検索結果

REXML::Element#get_text(path = nil) -> REXML::Text | nil (21307.0)

先頭のテキスト子ノードを返します。

...先頭のテキスト子ノードを返します。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字...
...il を返します。

@param path XPath文字列
@see REXML::Element#text

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持ってい...
...るが、前者を返す
doc.root.get_text.value # => "some text "
//}...

REXML::Element#text(path = nil) -> String | nil (3206.0)

先頭のテキスト子ノードの文字列を返します。

...る場合は最初のノードにしか
アクセスできないことに注意してください。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列...
...を返します。

@param path XPath文字列
@see REXML::Element#get_text

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持って...
...いるが、前者を返す
doc.root.text # => "some text "
//}...

cgi (48.0)

CGI プログラムの支援ライブラリです。

...してください。

* https://tools.ietf.org/html/draft-coar-cgi-v11-03
* 3875: The Common Gateway Interface (CGI) Version 1.1
* https://www.w3.org/CGI/

=== 使用例

==== フォームフィールドの値を得る

//emlist[][ruby]{
r
equire "cgi"
cgi = CGI.new
values = cgi['field_name']...
...して得るには CGI#params を使います。

//emlist[例][ruby]{
r
equire "cgi"
cgi = CGI.new
params = cgi.params
//}

また CGI#params は毎回同じ Hash オブジェクトを返すので
以下のような使いかたもできます。

//emlist[][ruby]{
cgi.params['new_field_name'] = ["va...
...//emlist[][ruby]{
r
equire "cgi"
cgi = CGI.new("html3") # HTML生成メソッドを追加
cgi.out() do
cgi.html() do
cgi.head{ cgi.title{"TITLE"} } +
cgi.body() do
cgi.form() do
cgi.textarea("get_text") +
cgi.br +
cgi.submit
end +
cgi.pre() do...