oc字符串的用法
#import <UIKit/UIKit.h>
#import "AppDelegate.h"int main(int argc, char * argv[]) {NSString *str=@"Hello OC";//普通字符定義NSString *str1=[NSString stringWithFormat:@"Number is %d",100];//工廠方法格式化字符串NSString *str2=[NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://netcorner.cnblogs.com"] encoding:NSUTF8StringEncoding error:nil];//會同步執行程序,就是網頁執行完以后才能執行后面的程序
NSLog(@"%@",str2);NSLog(@"%@",[str substringFromIndex:1]);//調用NSString的方法,如果要查看看多,請查看幫助文檔,菜單->Help->Documentation and API Reference}
?
總結
- 上一篇: 【C++基金会 06】explictke
- 下一篇: 所有可能出栈序列总数