1.NSString *str = [[NSString alloc]init]; Simple and rough, basically not used
2.NSString *str = [[NSString alloc]initwithformat:@ "xxx%@", str]; Favorite Common way.
3.NSString *str = [[NSString alloc]initwithstring:str];
4.NSString *str = [[NSString alloc]initwithnsdata: (NSData *) Encoding: (nsstringencoding)]; Convert encoding format
Note: encoding format:nsutf8stringencoding and so on.
nsdata* ext nsstring*: nsstring *< Span class= "PLN" >result = [[ Nsstring alloc] initwithdata : data encoding:nsutf8stringencoding
NSString * Turn nsdata*:nsdata* xmlData = [@"testdata" datausingencoding: Nsutf8stringencoding];
5.[str ISEQUALTOSTRING:NSSTR]; Comparing strings
6.[str uppercasestring]; Capital
7.[str lowercasestring]; Lowercase
8.[str capitalizedstring]; Capitalize first letter
9.[string1 Rangeofstring:string2]; Character Wear Search
10.[string1 Substringtoindex:3]; Intercepts from the beginning of a string to the specified position, but not to the character at that position
11.[string1 Substringfromindex:3]; Starts at the specified position (including the character at the specified position) and includes all subsequent characters
12.[string1 substringwithrange:nsmakerange (0, 4)]; Arbitrarily intercept substrings from a string in the given position, length
13.NSString *str = @ "DD SS DD";
Nsarray *array = [str componentsseparatedbystring:@ "]; Split string
iOS nsstring Common string operations split lookup