on 09-26-2007 8:13 AM
Hi everybody,
I got to split a string when ' occurs. But the string should not be splitted, when a ? is leading the '. Means: Not split when ?'
How has the regular expression to look like?
This does NOT work:
String constHOCHKOMMA = "[^?']'";
Sample-String:
String edi = "UNA'UNB'UNH?'xyz";
Result should be
<i>UNA
UNB
UNH?'xyz</i>
Thanks regards
Mario
String edi = "UNA'UNB'UNH?'xyz";
String splitted[] = edi.split("(?<!\?)'");
for (int i=0;i<splitted.length;i++) {
System.out.println (splitted<i>);
}
regards Franz
reward points if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.