title: remove duplicate character in string and make unique string
body: <p>I wrote a code and it works fine, But is there any easy and more handy way to implement that using javascript RegExp Object or any other way ?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function removeDuplicateChar(str) {
   var temp = [], j = 0;
   var arr = str.split("");
   arr.sort();
  
   for(var i = 0; i &lt; arr.length-1; i++) {
    if(arr[i] != arr[i+1]) {
     temp[j++] = arr[i];
    }
   }
   temp[j++] = arr[arr.length-1];
  
   for(var i = 0; i &lt; j; i++) {
    arr[i] = temp[i];
   }
  
   return arr.join("").substring(0,j);
  }
  console.log(removeDuplicateChar("Rasikawef dfv dd"));</code></pre>
  </div>
  </div>
  </p>