I was making an invalid character removal module for my program, and here is the function that I used:
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
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.