String parse with generics using format.