String stra = "hello";
String strB = "你好";
String str = String.format("%s中文是:%s",stra,strB); //hello中文是:你好

本文介绍了如何在Java中使用String.format()方法,将英文字符串与中文字符串结合,如'hello'与'你好',展示了一个实际操作的例子。
String stra = "hello";
String strB = "你好";
String str = String.format("%s中文是:%s",stra,strB); //hello中文是:你好

4532

被折叠的 条评论
为什么被折叠?