• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [OT] java question string parsing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] java question string parsing


  • Subject: Re: [OT] java question string parsing
  • From: Q <email@hidden>
  • Date: Tue, 12 Jun 2007 19:10:26 +1000


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@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden



-- Seeya...Q

Quinton Dolan - email@hidden
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@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >[OT] java question string parsing (From: Ute Hoffmann <email@hidden>)

  • Prev by Date: Re: [OT] java question string parsing
  • Next by Date: Re: Performance problem before and after growing WOWorkerThreads number
  • Previous by thread: Re: [OT] java question string parsing
  • Next by thread: WO 5.3.3/Tiger/No template found for component
  • Index(es):
    • Date
    • Thread