• 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: TitleCasing a String - probably a java question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: TitleCasing a String - probably a java question (From: "Jonathan Fleming" <email@hidden>)
 >Re: TitleCasing a String - probably a java question (From: Geoff Hopson <email@hidden>)
 >Re: TitleCasing a String - probably a java question (From: Geoff Hopson <email@hidden>)
 >Re: TitleCasing a String - probably a java question (From: Alexander Spohr <email@hidden>)
 >Re: TitleCasing a String - probably a java question (From: Geoff Hopson <email@hidden>)

  • Prev by Date: Re: Eclipse WOLips IDE Opinions
  • Next by Date: Re: iCal Revisited
  • Previous by thread: Re: TitleCasing a String - probably a java question
  • Next by thread: Getting A Value From An NSArray
  • Index(es):
    • Date
    • Thread