[VBScript] Parsing a string for number
Ok its late here and im having a retard moment.
In Javascript there is the parseInt function which returns a number from a string. eg: aString = "hi im 18 years old" using parseInt would give me 18 Is there a similar thing in VBScript of taking a integer/double etc from a string? Thanks to anyone who took time to view this... |
You can try using CInt("18") - I'm not 100% sure if it'll work/extract the nubmer from the string though.
|
There's no equivalent in vbscript. You could use the Split function to separate the sentence into words, then loop through the array and use the IsNumeric function on each word.
|
Nice one!
I knew i had done it somehow before.... and using the split then isNumeric method was the way i did it!@ I think this could very well be a definitive sign that partying does kill the brain cells. Thanks wondash. |
Quote:
|
All times are GMT -8. The time now is 07:13 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project