[]除了用“+"拼接,如何创建格式化字符串?
如其他语言:stirng.format("Today is %s year.", 2017) => Today is 2017 year.
Laya中有类似功能吗?(不要 + )
Laya中有类似功能吗?(不要 + )
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Monica - 知识达人
赞同来自:
以js为例:
// ES6:
var h = 'Hello';
var w = 'World';
var helloWorld = `${h} ${w}`;
console.log(helloWorld);
// 用在console
console.log("%s%d", "one plus one equals ", 2)