0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LSLでのヒアストリング

Posted at

ヒアストリング

多くのスクリプトは、変数に代入するStringを記述する際、書きやすくする&可読性を高めるためのヒアストリングに対応しているが、LSLではどうなのかを調べてみた。

結論、ないらしい。 _(:3」 ∠)_

やりたいこと

例えばPowerShellの書き方だと下記のようにJSONをprettyな書き方で変数に代入したい

$str = @'
{
  "name": "柴賢"
  "age": 3
  "isCool": true
}
'@

※ 結論: 残念ながら楽にはできない

仕方ないので以下のように書くしかないのかな。
スマートな書き方をご存じの方いらっしゃいましたら、どうかご教示ください <m(__)m>

代替方法

LSLだと以下のように書くしかない。
これ以上、楽な書き方が分からない…。

string test 
= "{\n"
+ "  \"name\" = \"柴賢\",\n"
+ "  \"age\" = 3,\n"
+ "  \"isCool\" = true,\n"
+ "}\n";

いやめんどくせぇええ

0
0
0

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
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?