var str='(0,0,0,0,0,0,1,2,0,0)'; var arr =str.replace(/[\(\)]/g,'').split(","); alert(arr[6]) alert(arr[7])