Skip to content
Search

NSString

lastmod 2015-04-04created 2014-02-123 edits

The basic string class of Objective-C.

Plain strings use "", but NSString uses @"". In format strings, %@ is also recognized as an NSString string.

Split string

How to split a string by a delimiter:

NSArray * separatedStringList = [dateString componentsSeparatedByString:@","];

String to valuable

How to convert a string to a number:

long long yourLong = [yourString longLongValue];
float yourFloat = [yourString floatValue];

Favorite site