Re: TitleCasing a String - probably a java question
Re: TitleCasing a String - probably a java question
- Subject: Re: TitleCasing a String - probably a java question
- From: Alexander Spohr <email@hidden>
- Date: Tue, 6 Jan 2004 11:33:29 +0100
hey geoff,
Arrrgghhh...Spot the compilation error - should never just type code
straight into mail...
StringBuffer buff = new StringBuffer(len);
you are so right,
this will throw a NullPointerException if oldStr is null.
int len = oldStr.length();
if (oldStr == null || len == 0) {
return oldStr;
}
should check for null before calling length()
:)
atze
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.