Last active
February 20, 2025 11:19
-
-
Save R0mb0/ec2c44cd5e18565ca90d54343b32dea7 to your computer and use it in GitHub Desktop.
Function to remove single letters from a text in Classic ASP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Private Function remove_single_letters_from_text(ByVal my_string) | |
Dim letters_array | |
letters_array = Array("q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m") | |
Dim temp_string | |
temp_string = my_string | |
Dim temp | |
For Each temp In letters_array | |
If InStr(temp_string, " " & temp & " ") <> 0 Then | |
temp_string = Replace(temp_string, " " & temp & " ", " ") | |
End If | |
Next | |
temp_string = Trim(temp_string) | |
remove_single_letters_from_text = temp_string | |
End Function | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment