Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 15578)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(working copy)
@@ -982,6 +1023,18 @@
     }

     /**
+     * Trim whitespaces from the strings {@code strings}.
+     *
+     * @param strings The list of strings to strip
+     * @return The resulting string
+     * @see Utils#strip
+     * @since xxx
+     */
+    public static List<String> trim_list(List<String> strings) {
+        return strings.stream().map(Utils::strip).filter(str -> !str.isEmpty()).collect(Collectors.toList());
+    }
+
+    /**
      * Check if two strings are similar, but not identical, i.e., have a Levenshtein distance of 1 or 2.
      * @param string1 first string to compare
      * @param string2 second string to compare
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(revision 15578)
+++ test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(working copy)
@@ -324,7 +324,20 @@
         assertTrue(c1.matches(new Environment(n1)));
     }

+    /**
+     * Test case for {@link Functions#trim_list}
+     */
     @Test
+    public void testTrimList() {
+        List<String> trimmed = Functions.trim_list(Arrays.asList(" A1 ", "A2", " A3", "A4 ", ""));
+        assertEquals(4, trimmed.size());
+        assertEquals("A1", trimmed.get(0));
+        assertEquals("A2", trimmed.get(1));
+        assertEquals("A3", trimmed.get(2));
+        assertEquals("A4", trimmed.get(3));
+    }
+
+    @Test
     public void testTicket8568() throws Exception {
         MapCSSStyleSource sheet = new MapCSSStyleSource(
                 "way { width: 5; }\n" +
