function(value) { let newValue = ""; for(var i = 0 ; i < value.length; i++){ let textCount = 2; if(i%textCount == 0){ newValue += value.substring(i,i+textCount) + "\n"; } if(i == value.length - 1 && i % textCount != 0){ newValue += value.substring(i,value.length); } } return newValue; }
标签:展示,换行,value,substring,length,textCount,let,大于,newValue From: https://www.cnblogs.com/webway/p/17040740.html