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