Skip to content

Instantly share code, notes, and snippets.

@badgercl
Created September 23, 2014 16:49
Show Gist options
  • Select an option

  • Save badgercl/80607295bea3b779edf7 to your computer and use it in GitHub Desktop.

Select an option

Save badgercl/80607295bea3b779edf7 to your computer and use it in GitHub Desktop.
Generate random string from alphabet
NSString *vowels = @"abcdefghijlmnopqrstuvwxyz1234567890";
NSMutableString *str = [NSMutableString new];
for(int i=0; i<10; i++){
[str appendString:[vowels substringWithRange:NSMakeRange(arc4random_uniform([vowels length]), 1)]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment