<script type="text/javascript">
String.prototype.trimCommon=function()
{
var obj={};
var set=[];
var len=this.length;
for(var i=0;i<len;i++)
{
var v=this.charAt(i);
if(typeof obj[v]=="undefined")
{
obj[v]=1;
}
}
var trimStr="";
for(var j in obj)
{
trimStr=trimStr+j;
}
return trimStr;
}
alert("hello".trimCommon());
</script>