format方法

format方法

 String s="你好'%s'我在东五环'%s'";
 s= s.format(s, "北京","望京");
 System.out.println(s);

 打印结果:

 你好'北京'我在东五环'望京'

posted @ 2022-10-28 16:47  __破  阅读(12)  评论(0)    收藏  举报