Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can anybody give some idea how to extract integer value from agiven string.

example-winfgttg2erer3
output should be 23

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 15-Oct-11 1:42am
v2
Comments
OriginalGriff 15-Oct-11 7:42am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

See the parseInt method[^]
 
Share this answer
 
Comments
Abhinav S 15-Oct-11 9:01am    
Interestingly, this method fails if the first character is not a number.
OriginalGriff 15-Oct-11 9:49am    
For some reason, that doesn't surprise me. :laugh:
There are a number of approaches discussed here[^] in this discussion.
You can try some of them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900