convert a string to another type automagically