小编dag*_*da1的帖子

如何处理多行字符串和字符串插值?

假设我想在某处有一个多行字符串的模板:

I have some
text with ${placeholders}
in this and some ${different}
ones ${here} and ${there}
Run Code Online (Sandbox Code Playgroud)

用用户输入替换占位符的最佳方法是什么?here-documents 会很好用吗?

string here-document

4
推荐指数
2
解决办法
6172
查看次数

标签 统计

here-document ×1

string ×1