On Sun, 6 Feb 2005 21:42:30 +0100, Andre van Toly <[EMAIL PROTECTED]> wrote: > // logon = s.equals("") ? null : StringSplitter.split(s);- logon = s.equals("") ? null : Arrays.asList(s.split(","));
+ logon = s.equals("") ? null : Arrays.asList( s.replaceAll("\\s", "").split(",") );
I don't want to be a pain, but how about logon="john doe" here. that'll become a bit unexpectedly "johndoe".
So, more generally, I think this is no good either...
The difficulty here is that in a lot of places the Array resulting form split() is put immediately in a List.
That leaves another five options:
1. Revive StringSplitter
2. Write a more difficult regular expression that trims whitespaces before and after an entry, before they are processed bij split().
3. Just split() and make sure you'll always trim() your string after you get it from the Array or List.
4. Use split, process the resulting Array and trim() all the strings it contains and put them back in
5. Do what is appropriate in every where it is needed, like here in the CloudTag.
Revive StringSplitter?
---Andr� -- Andr� van Toly http://www.toly.nl mobile +31(0)627233562 ------------------------------------------------------------------>><<-- _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
