您的位置:58编程 > 查看typescript版本 TypeScript 字符串concat()方法

查看typescript版本 TypeScript 字符串concat()方法

2023-05-10 20:33 TypeScript教程

查看typescript版本 TypeScript 字符串concat()方法

查看typescript版本 TypeScript 字符串concat()方法

查看typescript版本

TypeScript 字符串concat()方法

concat()方法添加两个或多个字符串并返回一个新的单个字符串。

语法

string.concat(string2, string3[, ..., stringN]);

参数详情

string2 ... stringN - 这些是要连接的字符串。

返回值

返回单个连接字符串。

示例

var str1 = new String( "This is string one" ); 
var str2 = new String( "This is string two" ); 
var str3 = str1.concat( str2 ); 
console.log("str1 + str2 : "+str3)

在编译时,它将在JavaScript中生成相同的代码。

其输出如下:

str1 + str2 : This is string oneThis is string two
阅读全文
以上是58编程为你收集整理的查看typescript版本 TypeScript 字符串concat()方法全部内容。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
相关文章
© 2024 58编程 58biancheng.com 版权所有 联系我们
桂ICP备12005667号-32 Powered by CMS