CE-1955 Replace _ with space in allCapsToMixedCase (for common use-case of an enum constant)

This commit is contained in:
2025-01-07 11:30:48 -06:00
parent f7cbf9d1c2
commit 5ad4216434
2 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public class StringUtils
/******************************************************************************* /*******************************************************************************
** allCapsToMixedCase - ie, UNIT CODE -> Unit Code ** allCapsToMixedCase - ie, UNIT_CODE -> Unit Code
** **
** @param input ** @param input
** @return ** @return
@ -127,7 +127,7 @@ public class StringUtils
return (input); return (input);
} }
return (rs.toString()); return (rs.toString().replace('_', ' '));
} }

View File

@ -105,6 +105,7 @@ class StringUtilsTest extends BaseTest
assertEquals("Foo bar", StringUtils.allCapsToMixedCase("FOo bar")); assertEquals("Foo bar", StringUtils.allCapsToMixedCase("FOo bar"));
assertEquals("Foo Bar", StringUtils.allCapsToMixedCase("FOo BAr")); assertEquals("Foo Bar", StringUtils.allCapsToMixedCase("FOo BAr"));
assertEquals("foo bar", StringUtils.allCapsToMixedCase("foo bar")); assertEquals("foo bar", StringUtils.allCapsToMixedCase("foo bar"));
assertEquals("Foo Bar", StringUtils.allCapsToMixedCase("FOO_BAR"));
} }