Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 17612)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 17613)
@@ -973,4 +973,34 @@
 
     /**
+     * Returns a title-cased version of the string where words start with an uppercase character and the remaining characters are lowercase
+     *
+     * Also known as "capitalize".
+     * @param str The source string
+     * @return The resulting string
+     * @since 17613
+     * @see Character#toTitleCase(char)
+     */
+    public static String title(String str) {
+        // adapted from org.apache.commons.lang3.text.WordUtils.capitalize
+        if (str == null) {
+            return null;
+        }
+        final char[] buffer = str.toCharArray();
+        boolean capitalizeNext = true;
+        for (int i = 0; i < buffer.length; i++) {
+            final char ch = buffer[i];
+            if (Character.isWhitespace(ch)) {
+                capitalizeNext = true;
+            } else if (capitalizeNext) {
+                buffer[i] = Character.toTitleCase(ch);
+                capitalizeNext = false;
+            } else {
+                buffer[i] = Character.toLowerCase(ch);
+            }
+        }
+        return new String(buffer);
+    }
+
+    /**
      * Trim whitespaces from the string {@code s}.
      * @param s The source string
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 17612)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 17613)
@@ -3,4 +3,5 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.data.osm.OsmPrimitiveType.NODE;
@@ -54,4 +55,14 @@
             return new Environment(osm);
         }
+    }
+
+    /**
+     * Unit test of {@link Functions#title}.
+     */
+    @Test
+    void testTitle() {
+        assertNull(Functions.title(null));
+        assertEquals("", Functions.title(""));
+        assertEquals("I Am Fine", Functions.title("i am FINE"));
     }
 
