function removeFirstCharacter(str : string, char : string) {
const found = str.indexOf(char);
if (found !== -1) {
return str.slice(0, found) + str.slice(found + 1);
}
return str;
}
let str = 'c++ c typescript python typescript php';
const char = 'j';
str = removeFirstCharacter(str, char);
console.log(str);
/*
run:
"c++ c typescript python typescript php"
*/