赞
踩
用String.format时,想让返回的内容有‘%’。测试时会报错:java.util.UnknownFormatConversionException: Conversion = ‘’’
比如
String str = String.format("%s%","100");
System.out.printf(str);
‘%’是特殊字符,想单独输出要转义。前面再加个’%'即可。如:
String str = String.format("%s%%","100");
System.out.printf(str);
https://www.cnblogs.com/zhangliang88/p/10621167.html
https://blog.csdn.net/wl724120268/article/details/103043503
https://www.jianshu.com/p/bdc8633d7fbc
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。