Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StringArrayParseHelper.java @ 9270:7337034eb5d5
multiple whitespace input fix
author | gernotbelger |
---|---|
date | Thu, 19 Jul 2018 13:36:38 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9269:83ebeb620b5a | 9270:7337034eb5d5 |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.client.client.ui; | |
11 | |
12 /** | |
13 * @author Domenico Nardi Tironi | |
14 * | |
15 */ | |
16 public class StringArrayParseHelper { | |
17 | |
18 public static final String[] getArrayFromRawString(final String raw) { | |
19 if (raw != null) { | |
20 return raw.trim().replaceAll("\\s+", " ").split(" "); | |
21 } | |
22 return new String[] {}; | |
23 } | |
24 | |
25 public static final String trimRawString(final String raw) { | |
26 if (raw != null) { | |
27 return raw.trim().replaceAll("\\s+", " "); | |
28 } | |
29 return ""; | |
30 } | |
31 | |
32 } |