代码是:
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "<html>" +
" <head>" +
" <title>" +
" %s" +
" </title>" +
" </head>" +
" <body>" +
" %s" +
" </body>" +
" </html>";
String str1 = String.format(str, "Home","Hallo");
System.out.println(str1);
}
我想打印str1
如下
//The str1 should need to print like this
<html>
<head>
<title>
Home
</title>
</head>
<body>
Hallo
</body>
</html>
这可能吗?