原文链接:http://1985wanggang.blog.163.com/blog/static/776383320121745626320/ a="one,two,three,four" 要将$a分割开,可以这样: OLD_IFS="$IFS" IFS="," arr=($a) IFS="$OLD_IFS" for s in ${arr[@]} do echo "$s" done 上述代码会输出 one
1.数组转字符串 var a, b; a = ,,,,); b = a.join("-"); 2.字符串转数组 var s = "abc,abcd,aaa"; ss = s.split(","); 3.数字转字符串toString ; var s = i.toString(); 4.字符串转数字 parseInt(字符串) parseInt("ssss999"); //错误 输出结果:NaN parseInt("99
swift 2.0 改变了一些地方,让swift变得更加完善,这里是一些最基本的初学者的代码,里面涉及到swift学习的最基本的字符串,数组,字典和相关的操作.好了直接看代码吧. class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a n