|
0
|
| Eric Labashosky · 技术社区 · 16 年前 |
|
1
4
你需要某种字典,其中包含不应该大写的单词。你可以用一个
|
|
|
2
2
您可以提出自己的方法和一组不希望“更正”的缩写,并将DO从转换中排除 |
|
|
3
0
我唯一能看到的是: 1. split your input text into words
2. iterate through words
2.a if word is a abbreviation then
2.a.1 do nothing or convert to uppercase, whatever is required
2.b otherwise
2.b.1 call [makeProper][1] or [capitalize][2]
makeProper
capitalize
|
|
|
4
0
Apache Commons-lang 包含WordUtils.capitalizely,我用它来大写字符串,没有问题。希望能节省你的时间。 |