From: Koncept Date: 2004-02-12T09:35:02+09:00 Subject: (noob) cast string to array? Hi. What a fantastic language. This is my first day learning using it and I *love* it so far. I am not very comfortable with Ruby speak yet, so I hope the explaination of my problem makes some kind of sense. I have a program that fetches some results from a shell script. The result is a string, not a block as it may look like below. result = { "foobar", "foobar", "foobar" } I want to basically remove the {}'s and replace them with [] and cast result as an array so that I can have some fun within Ruby. I figured something like this: result = result.sub(/\{/,'[') result = result.sub(/\}/,']') Now I have a string that *LOOKS* like and Array but isn't.... Any suggestions are more than welcome. -- Koncept << "Contrary to popular belief, the most dangerous animal is not the lion or tiger or even the elephant. The most dangerous animal is a shark riding on an elephant, just trampling and eating everything they see." - Jack Handey