2007/6/12, Ute Hoffmann <[EMAIL PROTECTED]>:
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?
that's easy:
String str = "VollstaendigReonviert";
for(int i = 0; i < str.lenght; i++)
{
char c = str.chatAt(i); // then char
if(Character.isUpperCase(c)) //is uppercase
{
String sub1, sub2;
sub1 = str.substring(0,i); // e.g. Vollstaending
sub2 = srt.substring(i);// e.g. Reonviert
str = sub1+" "+sub2;
i++; //to avoid it parse the save letter twice
}
}
if(str.charAt(0).equals(' '))
str = str.substring(0); //This because the method adds a space in
index=0 if the first letter is Upper
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/ildenae%40gmail.com
This email sent to [EMAIL PROTECTED]
--
--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]
--
Computers are like air conditioners -- they stop working properly if you
open
WINDOWS
_______________________________________________
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]