parse string method