|
SynopsisReturns all the numeric portion of a string. Related Functions: IsNumbersOnly, GetAlphaOnly and Strip Illegal Characters CODE ' GetDigitsOnly ' http://www.utteraccess.com/wiki/index.php/GetDigitsOnly ' Code courtesy of UtterAccess Wiki ' Licensed under Creative Commons License ' http://creativecommons.org/licenses/by-sa/3.0/ ' ' You are free to use this code in any application, ' provided this notice is left unchanged. ' ' rev date brief descripton ' 1.0 2011-04-05 Returns all the digits within a string. ' Public Function fnDigitsOnly(strInput As String) As String Dim intLen As Integer Dim intIndex As Integer Dim strChar As String * 1 Dim strTemp As String intLen = Len(strInput) For intIndex = 1 To intLen strChar = Mid(strInput, intIndex, 1) If (strChar >= "0") And (strChar <= "9") Then strTemp = strTemp & strChar End If Next intIndex ' Return fnDigitsOnly = strTemp End Function
|
| This page was last modified 09:08, 6 April 2011. This page has been accessed 1,269 times. Disclaimers |