るりまサーチ

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

別のキーワード

  1. sax2parser listen
  2. rexml/parsers/sax2parser listen
  3. json parser
  4. parser parse
  5. parser new

ライブラリ

検索結果

URI.decode_www_form(str, enc=Encoding::UTF_8) -> [[String, String]] (8.0)

文字列から URL-encoded form data をデコードします。

...ドは
https://url.spec.whatwg.org/#concept-urlencoded-parser
にもとづいて実装されています。
そのため「&」区切りのみに対応していて、「;」区切りには対応していません。

require 'uri'
ary = URI.decode_www_form("a=1&a=2&b=3")
p ary...
...y.assoc('b').last #=> '3'
p Hash[ary] #=> {"a"=>"2", "b"=>"3"}

@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正である場合に発生します
@see URI.decode_www_form_component, URI.encode_www_form...