I was making an invalid character removal module for my program, and here is the function that I used:
However, upon checking the output through a short debug, it appears that the backslash was never filtered out. I've tried many things, but none worked.
Help would be greatly appreciated.
Code:
Function fix_extensions(file_extension As String)
'Fixes file extensions
Dim banned_ext_chars() As String = {"\", "/", ":", ";", "*", "?", """", "<", ">", "|", "%", ",", "#", "$", "!", "+", "{", "}", "&", "[", "]", "", "'", "."}
For index As Integer = 1 To banned_ext_chars.Length - 1
file_extension = file_extension.Replace(banned_ext_chars(index), "")
Next
file_extension = "." & file_extension
Return file_extension
End Function
Help would be greatly appreciated.