//
//test string append
//字符串拼接
//
//多个字符串输入
func strappend(str:String...)->String
{
var strappend="";
for s in str
{
strappend += s;
}
return strappend;
}
println(strappend("hello ","everyone","."))
//数组形式输入
func strappend(strlist:[String])->String
{
var str="";
for s in strlist
{
str += s;
}
return str;
}
var s=["hello ","everyone","."]
println(strappend(s))
var ss = join("----",s)
println(ss)
var a = join([1,2],[[1,1],[2,2],[3,3]])
println("\(a)")
//输出结果:
hello everyone.
hello everyone.
hello ----everyone----.
[1, 1, 1, 2, 2, 2, 1, 2, 3, 3]