I have a function f similar to
function f(str){
alert(\"abc\"+str);
}
Now, I want to use JavaScript special charecter \"\\b\" in such a
EDIT: I realized this may not be what the OP was looking for, but it is definitely the easier way to remove characters from the end of a string in most cases.
You should probably just use string.substring or string.substr, both of which return some portion of string. You can get the substring from 0 to the string's length minus 2, then concatenate that with "yz" or whatever.