javascript string unique characters
const unique = (str) => {
const cleanStr = str.replace(/ /gi, '');
const set = [...new Set(cleanStr)];
return set;
}
console.log(unique('asdqwe asdqwet dfadqwre '));
javascript string unique characters
const unique = (str) => {
const cleanStr = str.replace(/ /gi, '');
const set = [...new Set(cleanStr)];
return set;
}
console.log(unique('asdqwe asdqwet dfadqwre '));
check a string for unique characters javascript
function checkForUnique(str){
var hashtable = {};
for(var i=0,len=str.length;i<len;i++){
if (hashtable[str[i]] != null){
hashtable[str[i]] = 1;
return false;
}else{
hashtable[str[i]] = 0;
}
}
return true;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us