Skip to content

Instantly share code, notes, and snippets.

@R0mb0
Last active March 4, 2025 07:34
Show Gist options
  • Save R0mb0/41d971ef4d94dbaafe1907e461096774 to your computer and use it in GitHub Desktop.
Save R0mb0/41d971ef4d94dbaafe1907e461096774 to your computer and use it in GitHub Desktop.
Function to remove all numbers from a text in Classic ASP
<%
'Function to remove double spaces from text
Function remove_double_spaces(ByVal my_string)
Dim temp_string
temp_string = my_string
Do While InStr(1, temp_string, " ")
temp_string= Replace(temp_string, " ", " ")
Loop
temp_string = Trim(temp_string)
remove_double_spaces = temp_string
End Function
'Function to remove all numbers from a text
Function remove_all_numbers_from_text(ByVal my_string)
Dim numbers_array
numbers_array = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
Dim temp_string
temp_string = my_string
Dim temp
For Each temp In numbers_array
If InStr(temp_string, temp) <> 0 Then
temp_string = Replace (temp_string, temp, "")
End If
Next
remove_all_numbers_from_text = remove_double_spaces(temp_string)
End Function
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment