NSString类 oc

  1. @“456454512213545”也是一个对象;
  2. NSString是继承NSObject的;OC的字符串用%@作为占位符;
  3. NSString *str = @"itcast";NSLog(@"我在%@上课",str);
  4. NSString的类方法:NS[NSString stringWithFormat:@"My age is %d and no is %d",age,no];
  5. 上面是调用了NSString的类方法;stringWithFormat;
  6. 在OC中创建对象都是用指针;
  7. 获取当前对象的长度:int size = [name length];length方法算的是字数;不是字符数;
原文地址:https://www.cnblogs.com/williamliuwen/p/5369822.html