• 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: 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.

  • Follow-Ups:
    • Re: TitleCasing a String - probably a java question
      • From: Geoff Hopson <email@hidden>
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>)

  • Prev by Date: WebService Correct Serializing
  • Next by Date: How to avoid instantiation of new WOComponents when reloading?
  • Previous by thread: Re: TitleCasing a String - probably a java question
  • Next by thread: Re: TitleCasing a String - probably a java question
  • Index(es):
    • Date
    • Thread