るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.059秒)
トップページ > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:ruby[x] > クエリ:j[x] > モジュール:JSON::Generator::GeneratorMethods::String[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

検索結果

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (9114.0)

自身から生成した JSON 形式の文字列を返します。

...から生成した JSON 形式の文字列を返します。

自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

@param state_or_hash 生成する JSON 形式の文...
... JSON::State のインスタンスか、
J
SON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

puts "test".to_json # => "test"
puts '"'.to_json # => "\""
puts "\\".to_jso...
...n # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...