Hey, how can i make an array out of a string which contains something like this:

name:Trainwreck,location:forum,xpos:12ypos:67

So that's my string, now i want to create an array out of this so that i can ask the value from that array by the name. So for example in my array i should be able to do this:


myArray.name; (should give me: Trainwreck)
myArray.xpos; (should give me: 12)
myArray.location; (should give me: forum)

etc.


So my question is, how can i convert a string like that to an array?