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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -