Array Element

In array have a big message like ("God is Great") .I want to split the words and stored into the different variables . a=God, b=is and c=Great.
pls give me a solution
anp_mcaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

butch_18445Commented:
try this
Dim Ar() As String, S As String
 
S = "God is Great"
 
Ar() = Split(S, " ")
 
Debug.Print Ar(0) 'prints God
Debug.Print Ar(1) 'prints is
Debug.Print Ar(2) 'prints Great

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anp_mcaAuthor Commented:
Thank you for your quick reply
array have lot of files details
ex:
a(0)=name, size, date, type and permission
a(1)=
.
.
a(n)=


I want to display the values in List View control . I need the details displayed in seperatly. consider this
0
butch_18445Commented:
well, you can use Split() like above to split into an array, then to add to a listview, you would do something like this.  if Ar() is your array, then:
Dim i As Integer, i2 As Integer
 
i = ListView1.ListItems.Count + 1
 
ListView1.ListItems.Add i, , Ar(0)
 
For i2 = 1 To UBound(Ar)
    ListView1.ListItems(i).SubItems(i2) = Ar(i2)
Next

Open in new window

0
anp_mcaAuthor Commented:
Ok
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.