Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove repeated characters from a string in javascript

const unrepeated = (str) => [...new Set(str)].join('');

unrepeated("hello"); //➞ "helo"
unrepeated("aaaaabbbbbb"); //➞ "ab"
unrepeated("11112222223333!!!??"); //➞ "123!?"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #repeated #characters #string #javascript
ADD COMMENT
Topic
Name
4+7 =