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: Geoff Hopson <email@hidden>
- Date: Tue, 6 Jan 2004 11:00:07 +0000
Right you are...double arrrgghhh :-)
int len;
if (oldStr == null || (len = oldStr.length()) == 0) {
return oldStr;
}
On 6 Jan 2004, at 10:33, Alexander Spohr wrote:
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.
--
Geoff Hopson
Objectology Ltd.
http://www.objectology.co.uk/
_______________________________________________
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.