Use to always go to find, or write down to convenient!!!
1. Intercepting strings
nsstring*string [email protected] "TATE_ZWT";
string = [strings substringtoindex:3];//after intercept of subscript 7
Wtlog (@ "Intercept value:%@", string);
2. Matching strings
nsstring*string [email protected] "TATE_ZWT";
Nsrangerange = [stringrangeofstring:@ "T"];//matches the resulting subscript
Wtlog (@ "rang:%@", Nsstringfromrange (range));
strings = [string substringwithrange:range];//Intercept range class
Wtlog (@ "Intercept value:%@", string);
3. Separating strings
nsstring*string [email protected] "TATE_ZWT_ZWT";
Nsarray *array = [String componentsseparatedbystring:@ "_"]; An array of 2 elements separated from character a
Wtlog (@ "array:%@", array); As a result, 3 objects are: Tate, ZWT, ZWT
IOS nsstring String Processing: intercepting strings, matching strings, separating strings