From 778ea640af5461e55de942a3631e83e6902f30be Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 7 Feb 2016 21:29:28 -0500 Subject: [PATCH] v0.3.4: even more titlecase improvements --- .../shatteredpixeldungeon/messages/Messages.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/Messages.java b/src/com/shatteredpixel/shatteredpixeldungeon/messages/Messages.java index a08cdf3c2..c653566ec 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/Messages.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/Messages.java @@ -153,7 +153,7 @@ public class Messages { private static final HashSet noCaps = new HashSet<>( Arrays.asList(new String[]{ //English - "a", "of", "by", "to", "the" + "a", "of", "by", "to", "the", "x" }) ); @@ -168,7 +168,7 @@ public class Messages { String result = ""; //split by any unicode space character for (String word : str.split("(?<=\\p{Zs})")){ - if (noCaps.contains(word.trim().toLowerCase().replaceAll(":", ""))){ + if (noCaps.contains(word.trim().toLowerCase().replaceAll(":|[0-9]", ""))){ result += word; } else { result += capitalize(word);