String Manipulation: Given a string like “This is a string”, I want to remove all single characters( alphabets and numerals) like (a, b, 1, 2, .. ) .
So the output of the string will be “This is string”
This is very urgent. Please help
Private Function ValidateSingleCharacter(pStrValue As String) As String
Dim strTmpArray() As String
Dim NoValue As Long, i As Integer
NoValue = UBound(Split(Trim(pStrValue), " "))
ReDim strTmpArray(NoValue) As String
strTmpArray = Split(Trim(pStrValue), " ")
For i = 0 To NoValue
If Len(strTmpArray(i)) = 1 Then strTmpArray(i) = "" else: strTmpArray(i) = strTmpArray(i) & " "
Next i
ValidateSingleCharacter = Join(strTmpArray, "")
End Function
I think this will help you