LoginSignup
3

More than 3 years have passed since last update.

posted at

updated at

C♯のjson文字列の中で式展開したいとき

  • 引用符はバックスラッシュ(\なり¥なり)でエスケープします。
  • {}を2つずつ重ねると文字列として扱われます。
var data = "something";
var json = $"{{\"hoge\":\"{data}}}\"";

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
3