String

Bigpapou
06-19-2001, 09:36 AM
Hi!
I've got this string with a number of space in it and I would like to make them disapear. I know of the Ltrim,Rtrim and trim but is there one that can trim in the middle of a string something like "trim(strString, Start, End)"

PWNettle
06-19-2001, 10:13 AM
Assuming you don't have access to the Replace$ function you could do something like this to remove spaces from within a string:
<PRE> Dim strExample As String

strExample = "Hello World!"

Do While InStr(strExample, " ")
strExample = Mid$(strExample, 1, InStr(strExample, " ") - 1) & Mid$(strExample, InStr(strExample, " ") + 1)
Loop

MsgBox strExample</PRE>Hopefully this helps or inspires,
Paul

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum