function changeLine(arr){ if(arr && arr.length>0){ for(var i in arr){ if(arr[i].length>6){ arr[i] = arr[i].replace(/(\S{6})(\S+)/,"$1\n$2"); } } } }