富贵资源网 Design By www.hznty.com

 这种方法将两个或多个字符串,并返回一个新的单字符串。
语法

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

下面是参数的详细信息:

  •     string2...stringN : 这些是要连接字符串。

返回值:

返回一个连接字符串。
例子:

<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
<script type="text/javascript">
var str1 = new String( "This is string one" );
var str2 = new String( "This is string two" );
var str3 = str1.concat( str2 );

document.write("Concatenated String :" + str3); 
</script>
</body>
</html>

这将产生以下结果:

Concatenated String :This is string oneThis is string two.

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com