I have a training program that is used by MANY different people. I have encountered many formatting issues already (like not allowing initials) but now I have a new one that I'm not sure about. When the code tests the name in the TextBox.Leave function, I can find if there is more than one space character in the box, and I can see if it is between the names, but if there is more than one, how do I remove ONLY one space?
bklynman01
2
Junior Poster in Training
Recommended Answers
Jump to PostTo remove ALL spaces:
myString = myString.Replace(" ", "")
To remove leading and trailing spaces:
myString = myString.Trim()
Note: this removes any white space, so newlines, tabs, etc. would be removed.
Jump to PostJohn<space>Doe gives John<space>Doe
?????????????????????
Jump to PostOk
All 9 Replies
vishalrane
0
Junior Poster in Training
bklynman01
2
Junior Poster in Training
vishalrane
0
Junior Poster in Training
vishalrane
0
Junior Poster in Training
Unhnd_Exception
vishalrane
0
Junior Poster in Training
bklynman01
2
Junior Poster in Training
Unhnd_Exception
bklynman01
2
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.