Fix bug in humaniseCamelCase.

This commit is contained in:
Fabian Becker 2014-11-07 21:59:28 +01:00
parent 7605dacb8a
commit 1dedb13dc9
2 changed files with 3 additions and 1 deletions

View File

@ -399,7 +399,7 @@ public final class StringTools {
* @return Readable String representation of input word
*/
public static String humaniseCamelCase(final String word) {
Pattern pattern = Pattern.compile("([A-Z]|[a-z])[a-z]*");
Pattern pattern = Pattern.compile("([A-Z]|[a-z])[a-z0-9]*");
List<String> tokens = new ArrayList<>();
Matcher matcher = pattern.matcher(word);

View File

@ -37,6 +37,8 @@ public class StringToolsTest {
map.put("thisIsAwesome", "This Is Awesome");
map.put("THQIsNice", "THQ Is Nice");
map.put("iLikeABC", "I Like ABC");
map.put("foo2Bar", "Foo2 Bar");
map.put("phi1", "Phi1");
String key, value;
for (Object o : map.entrySet()) {