Answer the question
In order to leave comments, you need to log in
How to search for Ghbdtn and return results for HELLO (ReactJS)?
Hello everyone
How to make a multilingual search?
How to search for GHBDTN and return results for HELLO (ReactJS)?
Answer the question
In order to leave comments, you need to log in
You can make a dictionary like this:
var kb = {
"q":"й",
"w":"ц",
"e":"у",
"r":"к",
"t":"е",
"y":"н"
// и дальше
};
function chkb(s) {
var ret = '';
for(let i = 0; i < s.length; i++) {
if(s[i] in kb) {
ret = ret + kb[s[i]];
} else {
ret = ret + s[i];
}
}
return ret;
}
console.log( chkb("qwer") ); // йцук
const dictionary = {
q: 'й',
w: 'ц',
// ...
};
const toRoman = str => [...str].reduce((acc, cur) => [...acc, dictionary[cur]], []).join('');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question