On 12/06/2007, at 6:15 PM, Ute Hoffmann wrote:

hallo,
is there someone around who can give me a hint how I could parse a String like "VollstaendigReonviert" into "Vollstaendig Reonviert"? Of course I do not know what is in the string beforehand, thus I need a means to check whether there are capital letters inside of the string and where. The remaining part is easy.

Any ideas?

Try this:

import java.util.regex.*;
...
String patternStr = "(?<=.)([A-Z])";
String replaceStr = " $1";

Pattern pattern = Pattern.compile(patternStr);
Matcher matcher = pattern.matcher(originalStr);
String newStr = matcher.replaceAll(replaceStr);


Thanks,
Ute

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/qdolan% 40gmail.com

This email sent to [EMAIL PROTECTED]



--
Seeya...Q

Quinton Dolan - [EMAIL PROTECTED]
Gold Coast, QLD, Australia
Ph: +61 419 729 806


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to