Friday, May 7, 2010

Get the Numeric value from a Alpha Numeric String

Get the Numeric value from a string which is containing numeric and string combinations with below code :-

strValue="DNT -1,21,21,123.99 value generated"
ActValue = ""
intStringLength = Len(strValue)
For intPos = 1 TO intStringLength
If IsNumeric(Mid(strValue,intPos,1)) Then
ActValue = ActValue & Mid(strValue,intPos,1)Else
If Mid(strValue,intPos,1) = "." Then
ActValue = ActValue & Mid(strValue,intPos,1) End If
End If
Next

No comments:

Post a Comment