#在蓝懿学习iOS的日子 # So we're going to review it today, the way we learned this time:
One, the conversion of numbers and texts I structure:
1. Convert the numbers into text:
L.text = [@ (X) stringvalue;
2. W converts the text into characters:
int a = L.text.intvalue;
Second, the concatenation of strings:
NSString * str1 = @ "abc";
nsstring * str2 = [nsstring string];
STR2 = @ "def";
1. Method One: Connect two strings together
nsstring * str3 = [nsstring stringwithformat:@ "%@%@", Str1,str2]
nsstring * STR4 = @ "4";
float pi =3.1415926535;
STR4 = [@ (pi) stringvalue];
STR4 = [nsstring stringwithformat:@ "%f", pi];
2, method Two: Connect a string behind another string;
nsstring * STR5 = [str1 stringbyappendingstring: str2];
NSLog(@ "STR5 =%@", STR5);
3, method Two: Is the method one and method two combination version:
nsstring * STR6 = [str1 stringbyappendingformat:@ "%@%f", str2,3.14];
The method is used and understood by the use of, to be more effective, before it can be used properly, please share the encouragement.
#在蓝懿学习iOSd的日子 #