Clear spaces between tex

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

Hallo,

How can i Clear empty spaces between text.
For example:

I've got the name "Justin Name" in a string and want to clear de spaces
between de names so i will get "JustinName".

What can i use to do that?

TIA Jan
 
use the VB 'Replace' function

newString = Replace(myString," ","")

hth

Guy
 
Hallo,

How can i Clear empty spaces between text.
For example:

I've got the name "Justin Name" in a string and want to clear de spaces
between de names so i will get "JustinName".

What can i use to do that?

TIA Jan

You can also try this:

imports System.Text.RegularExpressions

newString = Regex.Replace(oldString,"\s+","")

This way has the added benefit that it also takes care of tabs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top