Android开发笔记

Java中保留String空格

2019-06-21  本文已影响0人  道阻且长_行则将至

Java中保留String空格

有空格的地方用 \u0020 代替

String msg = MessageFormat.format("您是否要花费\u0020\u0020\u0020{0}\u0020\u0020\u0020钻石\n" +
                                                                "点亮一个月的{1}徽章权限?", price, name);

参考链接

How to keep the spaces at the end and/or at the beginning of a String?

上一篇 下一篇

猜你喜欢

热点阅读