function delReiteration(str) {
	var reg = /(.).*?\1/g;
	while (str.match(reg) != null) {
		str = str.replace(RegExp.$1, '');
	}
	return str;
}
var str = 'abcdfdcea13241342';
alert(delReiteration(str));

相关文章: