Showing posts with label String to Single char array converssion. Show all posts
Showing posts with label String to Single char array converssion. Show all posts

Friday, July 8, 2011

String to Single char array converssion

Function singleCharArr(inputString)
On error resume next
- Hide quoted text -
If inputString <> "" Then
Dim oRegEx, colChars, arrChars()
Set oRegEx = New RegExp
oRegEx.Global = True
oRegEx.IgnoreCase = True
oRegEx.Pattern = ".{1}"
Set colChars = oRegEx.Execute(inputString)
' Dim arrChars()
For i = 0 To colChars.Count - 1
Redim Preserve arrChars(i)
arrChars(i) = colChars.Item(i)
Next
Set colChars = Nothing
Set oRegEx = Nothing
singleCharArr = arrChars
Erase arrChars
End If
End Function



singleCharArr ("Shakeel Ahmed")