js的split用法

<script language="javascript">   
function spli(){   
         datastr="2,2,3,5,6,6";      
  var str= new Array();   
  
  str=datastr.split(",");      
    for (i=0;i<str.length ;i++ )   
    {   
        document.write(str[i]+"<br/>");   
    }   
}   
spli();   
</script>  

你可能感兴趣的:(java)