String htmlTemplate =
"<html> "
+" <head> "
+" <meta http-equiv='Content-type' "
+" content='text/html;charset=UTF-8'> "
+" <title>%s</title> "
+" </head> "
+" <body> "
+" <h1>%s</h1> "
+" </body> "
+"</html> ";
String html = String.format(htmlTemplate,"James Homepage","Welcome");
转载于:https://my.oschina.net/milize/blog/659186