Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is there a way to find all the combinations of a NSString in lowercase and uppercase

iphonegamedeveloperiphonegamedeveloper Posts: 437Registered Users @ @
Is there a way to find all the combinations of an NSString in lowercase and uppercase.

Ex: ABC,abc,Abc,ABc,aBC,abC

Replies

  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,692Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    If you're asking if there is something built-in to do this, the answer is no. You'll have to develop some logic to find them.
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | SlickShopper 2 | Leave a PayPal donation
  • dev666999dev666999 Posts: 3,632New Users @ @ @ @ @
    edited May 22
    I am glad @BrianSlick answered your question. I was also looking for @Duncan C to answer. Both of these posters really know their sh*t.

    Having said that, the brute force method (may not be the best solution) is to run a loop using objective C command "uppercasestring". Google it if you need more info.

    You would be doing this...

    Lets use "apple" as an example.

    Capitalize the first Letter...Apple... then move the single capital to the next letter "P". Repeat until you reach the "e". Now do the same for the first two letters... so APple...then move the capitalization x 2 to the next iteration...aPPle. Do this until you hit the "e". Then do the same for 3 letters, then 4, and finally all 5 with all capitals... APPLE. If you have basic programming skills you should be able to write code that executes this. It may require a loop within a loop or 5 separate loops. You decide which is more practical based on your coding skills.
Sign In or Register to comment.