- Home
·
- String Manipulation
·
- This small function will remove inner and outer spaces source string. works very fast.
This small function will remove inner and outer spaces source string. works very fast.
This small function will remove inner and outer spaces source string. works very fast.
Rate This small function will remove inner and outer spaces source string. works very fast.
(1(1 Vote))
Dim i_len As Integer
Dim i As Integer
Dim k As Integer
Dim s_temp_1 As String
Dim s_temp_2 As String
s_source_string = Trim(s_source_string) '// remove most right and most left empty string
i_len = Len(s_source_string)
k = 2 '// we start with second letter
For i = k To i_len
s_temp_1 = Trim(Mid(s_source_string, i, 1)) '// second charachter
s_temp_2 = Trim(Mid(s_source_string, (i + 1), 1)) '//third charachter
If Len(s_temp_1) = 0 And Len(s_temp_2) = 0 Then '// both are empty spaces
s_source_string = left(s_source_string, i) & Trim(Mid(s_source_string, i + 2))
i_len = Len(s_source_string)
k = i
End If
Next i
RemoveInnerSpace = s_source_string
End Function
This small function will remove inner and outer spaces source string. works very fast. Comments
No comments yet — be the first to post one!
Post a Comment