//
// main.m
// OC 04 string
//
// Created by lanou on 15/8/11.
// Copyright (c) 2015年 lanou. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
// c语言的字符串和oc不同
// C语言采用char型数组保存字符串,采用ASCII编码
// oc采用的NSString保存字符串,采用unichar(unicode)编码
NSString *str = [[NSString alloc]initWithFormat:@"二郎神打马娄婧"];
NSLog(@"%@",str);
NSString *str1 = [[NSString alloc]initWithFormat:@"姓名:%@ ,学号:%d",@"l",38 ];
NSLog(@"%@",str1);
//
NSString *str2 = [NSString stringWithFormat:@"%@",@"hi" ];
NSLog(@"%@",str2);
// 初始化有两种方法
// 指定初始化
// 类名 *对象 = 【类名 alloc】initWith.....】;
// 便利构造器
// 类名 *对象 = 【类名 便利构造器】;
// 求字符串长度
// NSString *str3 = @"1234