•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 375,273 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,221 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Another Small And Simple Function To Take Each Character of a string, and put it into an Array, This helps significantly when you need to sift through a string. This Function Uses The spush (String Push) Function, Also In Code Snippits.
Public Function str2Array(xString As String) As String() Dim tmpArray() As String Dim tmpchar As String ' /* For Each Character In The String */ For I = 1 To Len(xString) ' /* Retrieve The Character */ tmpchar = Mid(xString, I, 1) ' /* Push It Into The Temporary Array */ spush tmpArray, tmpchar Next I ' /* Return The Array To The Calling Procedure */ str2Array = tmpArray End Function
Comments (Newest First)
wilsonjan | Newbie Poster | Oct 18th, 2006
•
•
•
•
Apologies, I was being a bit dim and thought this group included .net
:cry:
:cry:
wilsonjan | Newbie Poster | Oct 18th, 2006
•
•
•
•
Couldn't you just do:
The only difference would be that you'd have a char array instead of a string array.
Alternatively, a better way in .net 2.0 would be to use the Array.ConvertAll method.
Regards,
Jan.
xString.ToCharArray
The only difference would be that you'd have a char array instead of a string array.
Alternatively, a better way in .net 2.0 would be to use the Array.ConvertAll method.
Regards,
Jan.
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)