indexOf returns a number, so why are you using parseInt to start with?
Joined: Nov 08, 2001
Regular Expression may be easier:
Joined: Jan 16, 2009
Thanks for the reply. I am not sure if reg exps are right for my requirement. The string that I am searching looks like this 'xyz - 34534, y.5'.
I need to fetch the integer between the hyphen and the comma. This integer is of variable length. The only things that remain constant in this string are the hyphen and comma.