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: Mon, 12 Jan 2004 10:14:06 +0000
Flogging a dead horse here, but I just noticed that if all you are
doing is displaying the string in a browser, then you can use a CSS
rule to capitalize the string
e.g. in CSS
.capitalize {
text-transform: capitalize;
}
in HTML:
<td class="capitalize">your string here</td>
Geoff
On 6 Jan 2004, at 11:00, Geoff Hopson wrote:
> 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.
>
>
--
Geoff Hopson
Objectology Ltd.
http://www.objectology.co.uk/
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.