How to format??

Discussion in 'iOS Programming' started by arnieterm, Oct 15, 2008.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    I have an NSString that contains the phone # [only phone number]. I want to format this string to display in this way "###-###-####". What parameter should I pass to stringWithFormat or initWithFormat?
    Can anybody suggest?
    Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Personally I'd use the class that's actually designed for formatting numbers. The well documented NSNumberFormatter.
     

Share This Page