function to parse char vectors