非常简单,就用一个"+"将两个字符串"相加": var longString = "One piece " + "plus one more piece."; 要将多个字符串累积为一个字符串,还可以使用"+="操作符: var result = ""; result += "My name is Anders" result += " and m
举个例子,将字符串所有单词倒序,用replace()处理是如此简单. <script language="网页特效"> var strm = "网页特效 is a good script language"; function change(word) { var result = word.match(/(w)/g); if ( result ) { var str = ""; for ( var i=result.length-1