By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,825 Members | 2,437 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,825 IT Pros & Developers. It's quick & easy.

regular expression question to remove blank spaces

P: n/a
Given this:

"[<][^>]*[>]"

the pattern to remove the htnl code between brackets, how can I remove a
series of spaces and just make one space.

like here is a series of blank spaces

thanks

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Danny wrote:
Given this:

"[<][^>]*[>]"

the pattern to remove the htnl code between brackets, how can I remove a
series of spaces and just make one space.

like here is a series of blank spaces

thanks


call like this
Dim strWOSpaces As STring
Dim s As STring
s = "like here is a series of blank spaces"
strWOSpaces = RemSpace(s)

Public Function RemSpace(strLine As Variant) As String
Dim intFor As Integer
Dim strChar As String

For intFor = 1 To Len(strLine)
strChar = Mid(strLine, intFor, 1)
If strChar = Space(1) Then
Do While Mid(strLine, intFor, 1) = Space(1)
intFor = intFor + 1
Loop
intFor = intFor - 1
End If
RemSpace = RemSpace & strChar
Next
End Function

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.