Jan,
In addition to the other suggestions, I would look at using the
System.Text.RegularExpressions.Regex.Replace method, searching for white
space, replacing it with a semi-colon.
Something like:
Dim input As String = "vr 12-12-79 city village state
name"
Dim output As String
output = System.Text.RegularExpressions.Regex.Replace(input , "\s+", ";")
Debug.WriteLine(input, "input")
Debug.WriteLine(output, "output")
The "\s+" above is one or more white space characters.
If you are doing multiple of these replacements, I would consider creating
an instance of the RegEx class.
Dim re as New System.Text.RegularExpressions.Regex("\s+")
Dim reader as StreamReader
Dim input As String
Dim output As String
input = reader.ReadLine()
Do Until input Is Nothing
output = re.Replace(input, ";")
input = reader.ReadLine()
Loop
Hope this helps
Jay
"Jan" <ca*****@planet.nl> wrote in message
news:2r*****************************@40tude.net...
Hi there,
Is there a way to remove spaces from a line of text?
For example:
vr 12-12-79 city village state name
I want it to be:
vr;12-12-79;city;village;state;name
Thx in advance