| View previous topic :: View next topic |
| Author |
Message |
Gilad_r Centurion
Joined: 03 Mar 2004 Posts: 156
|
Posted: Apr 21st, 2004 09:35 PM Post subject: TrimEx |
|
|
trim those extra spaces right out... :thumbs:
[vb:1:1fa034202a]Private Function TrimEx(ByVal sText As String) As String
Dim p As Long
sText = Trim$(sText)
p = InStr(1, sText, " ")
If p = 0 Then TrimEx = sText: Exit Function
TrimEx = Left$(sText, p) & TrimEx(Mid$(sText, p + 2, Len(sText) - p - 1))
End Function[/vb:1:1fa034202a] _________________ "you should make amends with you" (Incubus) |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Apr 21st, 2004 09:53 PM Post subject: |
|
|
Side Note:
For those not aware, Trim() removes the leading and trailing spaces. How is this function different? Well, this removes all those dastardly "double-spaces" and reduces all that whitespace down to a single space.
Just don't let your typing teacher see it (remember, 2 spaces after each sentence) ^_^ _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
Gilad_r Centurion
Joined: 03 Mar 2004 Posts: 156
|
Posted: Apr 21st, 2004 10:22 PM Post subject: |
|
|
lol, yeah, i probably should have explained a bit more...
thanks! _________________ "you should make amends with you" (Incubus) |
|
| Back to top |
|
|