57,字符串的基本知识
来源:互联网 发布:内容管理系统cms 开源 编辑:程序博客网 时间:2024/05/01 11:27
#import <Foundation/Foundation.h>
/*
OC中的字符串是一个对象,有丰富的字符串处理方法,前面使用@符号,很好得支持中文。
注:C语言的字符串是一个基本数据类型,没有处理方法。
*/
int main(int argc,constchar * argv[]) {
@autoreleasepool {
//1,存储字符串的两种方法
NSString *name = @"ljs";
NSString *content = [NSStringstringWithFormat:@"Iphone:%@;Meg:%@",@"13411379410",@"你好"];
NSLog(@"name = %@",name);
NSLog(@"content = %@",content);
//2,求字符串的个数(长度),而不是求其字符数哦
NSInteger len = [name length];
NSLog(@"len = %lu",len);
}
return 0;
}
//2015-12-05 18:05:33.898 1,字符串基本概念[850:162854] name = ljs
//2015-12-05 18:05:33.899 1,字符串基本概念[850:162854] content = Iphone:13411379410;Meg:你好
//2015-12-05 18:05:33.899 1,字符串基本概念[850:162854] len = 3
//Program ended with exit code: 0
- 57,字符串的基本知识
- OC字符串的基本知识
- C语言字符串的基本知识
- JavaScript的一些基本知识 -- 字符串
- python字符串基本知识
- String字符串基本知识
- Python中的字符串索引基本知识
- java常用的数组、字符串、集合操作以及数据结构与算法基本知识
- 就刚起步而言,我认为需要了解的基本知识(字符串)
- Indie音乐的基本知识
- UNIX的一些基本知识
- 接口技术的基本知识
- python的基本知识
- 硬盘的基本知识
- Oracle数据库的基本知识
- ape的基本知识
- QQ号码的基本知识
- 计算机编码的基本知识
- Hadoop WordCount代码
- PHP面向对象 1.6 常见的关键字
- 聚类分析:基本概念梳理
- android初学笔记,TextView及其派生组件的基本用法
- LibGDX_6.5: 常用系统控件: 文本框(TextField)
- 57,字符串的基本知识
- Linux c 算法与数据结构--栈
- 【Python】Python 三种导入模块的方法和区别
- android四大组件--ContentProvider详解
- 第十四周项目二 二叉树排序树中查找的路径
- UISearchBar 搜索框
- Linux sudoers error解决办法
- Mac OS X 下 TAR.GZ 方式安装 MySQL
- LibGDX_7.1: 内存管理