split 和 split 有什么区别
split(“\\s+“)
按空格,制表符,等进行拆分
(也就是说它是按空白部分进行拆分,不管这个空白使用设么操作留下
的,提如空格键
tab键)
split(“
+“)
按空格进行拆分(也就是说只有按空格键流出来的空白才会是拆分的一句)
Captain的《Satellites》 歌词
歌曲名:Satellites
歌手:Captain
专辑:Keep An Open Mind
Frankie Storm - Satellite
Sending signals from a distance
Careful not to empty your space
Watching, waiting for you
To shoot another signal my way
And I hope that you would feel the same
And I hope that our worlds collide one day
So I’m watching, waiting
Spinning out of control
And oh,
Floating out here in the cold
So afraid of getting too close
Will you pull me in when I approach
Let me burn up in your orbit
Can’t help what gravity’s up to
Never seen anything like you
But oh,
Will you pull me in when I approach
Or let me go and watch me float
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Now your holding your position
Forcing me to be the one to move
Stuck here in a vacuum
As a circle from far away
And I hope that you would feel the same
And I hope that our worlds collide one day
So I’m watching, waiting
Spinning out of control
And oh,
Floating out here in the cold
So afraid of getting too close
Will you pull me in when I approach ?
Let me burn up in your orbit
Can’t help what gravity’s up to
Never seen anything like you
But oh,
Will you pull me in when I approach
Or let me go and watch me float
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
Atmospheres touch
Your heavenly body
Even the stars know you want me
You got me
Yeah, yeah, yeah, yeah, yeah
And oh,
Floating out here in the cold
So afraid of getting too close
Will you pull me in when I approach
Let me burn up in your orbit
Can’t help what gravity’s up to
Never seen anything like you
But oh,
Will you pull me in when I approach
Or let me go and watch me float
Like a satellite (Like a satellite)
Like a satellite (Like a satellite)
http://music.baidu.com/song/2646512
javascript:如何以空格分割字符串
可以使用split()函数进行分割,以空格分割并返回数组实例:
《script language=“javascript“》
var str=“这 是 字 符 串“;
var arr=str.split(“ “);
《/script》
这个结果的数组arr的值:arr=’这’;arr=’是’;arr=’字’;arr=’符’;arr=’串’;split()是javascript的String对象属性的一个方法;
语法结构是stringObject.split(separator,howmany),拥有两个参数,第一个参数是以什么字符进行分割,第二个参数是返回的数组的最大长度,实例:
《script language=“javascript“》
var str=“这 是 字 符 串“;
var arr=str.split(“ “,2);
《/script》
这个结果数组arr只有两个元素:arr=’这’;arr=’是’;