public static String mergeFromTemplate ( String template , Map < String , ? > values ) { for ( String param : values . keySet ( ) ) { template = template . replace ( "{{" + param + "}}" , values . get ( param ) == null ? "" : values . get ( param ) . toString ( ) ) ; } return template . replaceAll ( "\n|\r| " , "" ) ; }
Merges from string as template .