关于javascript的split的用法
2010-09-14 13:06:21 来源:WEB开发网核心提示:<script language="javascript">var t1="ABC,SDF,SF,DFG,";var t2="ABC,SDF,SF,DFG";var a1=t1.split(",");var a2=t2.spli
<script language="javascript">
var t1="ABC,SDF,SF,DFG,";
var t2="ABC,SDF,SF,DFG";
var a1=t1.split(",");
var a2=t2.split(",");
alert(a1.length); //长度为5
alert(a2.length); //长度为4
for(i=0;i<a1.length;i++)
{
alert(a1[i]); //以“,”分割取值
}
</script>
Tags:关于 javascript split
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接