Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String manipulation with Javascript (NodeJS)

I'm trying to remove the first 13 characters of a string with this code:

requestToken = requestToken.substring(13);

However, I'm getting "has no method substring" error with NodeJS, the code above that mostly recommended in the Javascript forums does not work with NodeJS?

like image 336
quarks Avatar asked Apr 26 '12 17:04

quarks


1 Answers

it seems like requestToken may not be a string.

Try

requestToken = '' + requestToken;

and then requestToken.substring(13);

like image 123
ControlAltDel Avatar answered Sep 30 '22 19:09

ControlAltDel