本文介绍了在Java中使用toUpperCase()将ß.cfg转换为大写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试遵循代码
String s1 = "ß.cfg";
System.out.println (s.toUpperCase());
我得到的
输出为 SS.CFG
,因为Unicode并未定义ß的大写版本,而我希望输出为ß.CFG
.
output I am getting is SS.CFG
since Unicode didn't define an uppercase version of ß while I want the output as ß.CFG
.
有什么办法可以实现?
推荐答案
toUpperCase(Locale)
明确指出将要发生的情况:
The documentation for toUpperCase( Locale )
explicitly states that this is what will happen:
小写字母s->两个字母:SS
small letter sharp s -> two letters: SS
这篇关于在Java中使用toUpperCase()将ß.cfg转换为大写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!