| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Strip Non-Numeric characters from string function
<%
Function StripNonNumeric(strInput) Dim iPos, sNew, iTemp strInput = Trim(strInput) If strInput <> "" Then iPos = 1 iTemp = Len(strInput) While iTemp >= iPos If IsNumeric(Mid(strInput,iPos,1)) = True Then sNew = sNew & Mid(strInput,iPos,1) End If iPos = iPos + 1 Wend Else sNew = "" End If StripNonNumeric = sNew End Function %> |
|
#2
|
|||
|
|||
|
Function stripNonNumeric(stringIn)
if stringIn <> "" then dim stringOut strIn = replace(stringIn,"'","") For I = 1 to len(stringIn) if isNumeric(mid(stringIn,I,1)) = true then stringOut = stringOut & mid(stringIn,I,1) Next stripNonNumeric = stringOut else stripNonNumeric = stringIn end if End Function Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Strip Non-Numeric characters from string function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|