1. Strings
1) simple string
Nsstring * astring =@"This is a string"; Nsstring* Anotherstring =@"And this is another one";
2) object initialization
Nsstring * astring = [[nsstring alloc] initwithstring:@"Some string literal"]; Nsstring* Astring = [nsstring stringwithstring:@"Some string literal"];
3) format the string
IntThevalueofpi =3;//Produces the string "Pi is exactly 3! "Nsstring * astring = [nsstring stringwithformat:@"Pi is exactly % d!", Thevalueofpi];
4) object formatting
Nsstring * astring =@"Criminals"; Nsstring* Anotherstring = [nsstring stringwithformat:@"When you % @ strings, only % @ willuse strings.",@"Criminalize", Astring];
5) string comparison
Nsstring * astring =@"Hello"; Nsstring* Anotherstring =@"Hello"; Bool stringsareequal= ([Astring is1_tostring: anotherstring]);
Bool stringsareequal = (astring = anotherstring); // This is incorrect.