How can I remove tab from a any string on javascript?
when I get my string it comes as a buffer like this:
<Buffer 0d 0a 3c 25 72 65 73 70 6f 6e 73 65 2e 73 74 61 74 75 73 20...>
function translate(data) {
var content = data.toString().split('\r\n');
}
and then I perform the following...
for example, I have these lines:
'\t\t var session = request.getSession();'
'\t\t session["user"] = {};'
and I just want it to be:
'var session = request.getSession();'
'session["user"] = {};'
by the way, when I do:
content=String(content).replace('\t','');
this is why I need the String(...) constructor.
if I wont use it, ill get the object has no method replace.
assuming content is the string i want to parse it parses it by letter meaning this:
'\t session'
becomes this:
's','e','s','s','i','o','n'
why?