I'm trying to get the initial number value of a string using jQuery/Javascript. Right now, the string I'm getting is:
2 <a href="user/[email protected] ">view</a>
I'm trying to take this string (which is stored in a variable, and take only the initial number from it. Normally, I would take only the first digit, but I'm want to make this flexible, so the number could be any digits in length (for example, "2" to "20,000,000"), so I know that just taking the first few digits doesn't work.
Does anyone out there have a solution? Thank you for your time!