input revMap and string, output string replaced based on revMap