I'm trying to have it so that my textbox (which gets its input from a SaveFileDialog) will replace any spaces with an underscore.
So far, this is the code i have.
But this changes every space in the file location to an underscore. The problem being that not all my directories have underscores...
So for example, "C:\Users\J oe Smith\file name.txt"
will become "C:\Users\Joe_S mith\file_name. txt"
but you can obviously see the issues coming from that.
Any suggestions?
So far, this is the code i have.
Code:
Private Sub boxDestin_TextChanged(sender As Object, e As EventArgs) Handles boxDestin.TextChanged
Dim removespaces As String
removespaces = boxDestin.Text
boxDestin.Text = Replace(removespaces, " ", "_")
end sub
So for example, "C:\Users\J oe Smith\file name.txt"
will become "C:\Users\Joe_S mith\file_name. txt"
but you can obviously see the issues coming from that.
Any suggestions?
Comment