var a = c3; var you = a.indexOf('有限责任公司'); var b = a.substring(0,you); var wu = b.indexOf('无限责任公司'); var name = b.substring(0,wu); result = name;