1// this will replace the first occurrence of "www." and return "testwww.com"
2"www.testwww.com".replace("www.", "");
3
4// this will slice the first four characters and return "testwww.com"
5"www.testwww.com".slice(4);
6
7// this will replace the www. only if it is at the beginning
8"www.testwww.com".replace(/^(www\.)/,"");
1function removeCharsFromStart(str, charCount){
2 str = str.slice(charCount);
3 return str;
4}