坐标轴大于7个字的取前三个字和后四个字,中间加省略号的js怎么写
单元格公式 if(len($$$)>0,mid($$$,1,3)+"..."+min($$$,len($$$)-4,len($$$)),$$$)
js
var a="cffgfgfdgdfgdfg"
var b="";
if(a.length>7){
b=a.substring(0,3)+"..."+a.substring(a.length-4,a.length)
}
..
function () {
if (this.length > 7) {
return this.substr(0, 3) + "..." + this.substr(this.length - 4, this.length);
} else {
return this;