how to parse string to int in javascript -
i want int string in javascript how can them
test1 , stsfdf233, fdfk323,
are show me method integer string.
it rule int in of string.
how can int @ last in string
var s = 'abc123'; var number = s.match(/\d+$/); number = parseint(number, 10);
the first step simple regular expression - \d+$
match digits near end.
on next step, use parseint
on string we've matched before, proper number.
Comments
Post a Comment