How to parse a string variable?