当前位置:网站首页>Objective-C string class, array class
Objective-C string class, array class
2022-07-04 03:34:00 【Zyryck】
String class :
NSString* str1 = @"dancer";
NSString* str2 = [[NSString alloc] initWithFormat:@"%d beijing",1949];
NSString* str3 = [NSString stringWithFormat:@"%ld beijing",1948];
NSUInteger len = str1.length;
// Calculate the length
// notes : One Chinese character and one length
NSLog(@"%lu",len);
// More equal
BOOL result = [str1 isEqualTo:str2];
if(result){
NSLog(@" equal ");
}else{
NSLog(@" It's not equal ");
}Array class :
//NSMutableArray Variable array
NSMutableArray* array = [[NSMutableArray alloc]init];
// Arrays can hold objects of any type
// Additions and deletions
[array addObject:@"obj1"];
// Delete by object
[array removeObject:@"obj1"];
// Delete... By index
[array removeObjectAtIndex:0];
// Accessing array elements
NSString* item1 = array[0];边栏推荐
- I stepped on a foundation pit today
- PMP 考試常見工具與技術點總結
- 96% of the collected traffic is prevented by bubble mart of cloud hosting
- Consul of distributed service registration discovery and unified configuration management
- Object oriented -- encapsulation, inheritance, polymorphism
- Backpropagation formula derivation [Li Hongyi deep learning version]
- Leecode 122. Zuijia timing of buying and selling stocks ②
- 基于PHP的轻量企业销售管理系统
- XSS prevention
- Li Chuang EDA learning notes IX: layers
猜你喜欢

Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog

Add token validation in swagger

选择排序与冒泡排序模板
![Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]](/img/0d/7a8370d153a8479b706377c3487220.jpg)
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]

Record a problem that soft deletion fails due to warehouse level error

No clue about the data analysis report? After reading this introduction of smartbi, you will understand!

Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami

Third party login initial version

微信公众号网页授权

I stepped on a foundation pit today
随机推荐
[latex] production of complex tables: excel2latex and detail adjustment
Li Chuang EDA learning notes IX: layers
CSP drawing
MySQL query
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
Teach you how to optimize SQL
Zlmediakit compilation and webrtc push-pull flow testing
Dare to climb here, you're not far from prison, reptile reverse actual combat case
PMP 考試常見工具與技術點總結
Love and self-discipline and strive to live a core life
Sword finger offer:55 - I. depth of binary tree
Recent learning fragmentation (14)
Imperial cms7.5 imitation "D9 download station" software application download website source code
7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
The 37 year old programmer was laid off, and he didn't find a job for 120 days. He had no choice but to go to a small company. As a result, he was confused
[database I] database overview, common commands, view the table structure of 'demo data', simple query, condition query, sorting data, data processing function (single row processing function), groupi
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类
MySQL is dirty
warning: LF will be replaced by CRLF in XXXXXX
Zigzag scan