Hey, how do i make it so in a string, say
MESSAGE
it'll take any SPACES and put them as only ONE.
like
if Message= "Hey Man WHAT U UP TO ?"
it'll become
"Hey Man WHAT U UP TO ?"
Printable View
Hey, how do i make it so in a string, say
MESSAGE
it'll take any SPACES and put them as only ONE.
like
if Message= "Hey Man WHAT U UP TO ?"
it'll become
"Hey Man WHAT U UP TO ?"
Both of those strings are the same...
do you mean you want to make:
well - if so, this might seem a bit dodgy but you could do this:Code:"Hey man what you up to?"
'go to
"Hey man what you up to?"
'??
hope this is what you meant...Code:Dim TheString As String
Dim TempString As String
'Set up the strings
TheString = "Hey man what you up to?"
TempString = ""
'Replace 2 spaces " " with one space " " as long as
'the last replace actually made a change. When no change
'then stop replacing.
Do While TempString <> TheString
TempString = TheString
TheString = Replace(TheString, " ", " ")
Loop
MsgBox TheString