当前位置:网站首页>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];边栏推荐
- Is online futures account opening safe and reliable? Which domestic futures company is better?
- 2006 translation
- XSS prevention
- [PaddleSeg 源码阅读] PaddleSeg 自定义数据类
- Day05 錶格
- 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?
- Explain AI accelerator in detail: why is this the golden age of AI accelerator?
- Rhcsa day 3
- 2022 registration examination for safety production management personnel of fireworks and firecracker production units and examination skills for safety production management personnel of fireworks an
- Setting methods, usage methods and common usage scenarios of environment variables in postman
猜你喜欢

WP collection plug-in free WordPress collection hang up plug-in

Typical applications of minimum spanning tree

Jenkins configures IP address access

Third party login initial version

基于PHP的轻量企业销售管理系统

Nbear introduction and use diagram
![[latex] production of complex tables: excel2latex and detail adjustment](/img/39/0d448ddf006eda262de3ed75666354.jpg)
[latex] production of complex tables: excel2latex and detail adjustment
![[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush](/img/94/2bdc31ec05595dbbc8a7a8d6b22252.jpg)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush

Don't disagree, this is the most powerful "language" of the Internet

Li Chuang EDA learning notes IX: layers
随机推荐
I stepped on a foundation pit today
Imperial cms7.5 imitation "D9 download station" software application download website source code
微信公众号网页授权
Defensive programming skills
Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
The property of judging odd or even numbers about XOR.
@Scheduled scheduled tasks
JS object definition
Typical applications of minimum spanning tree
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类
New year's first race, submit bug reward more!
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
[UE4] parse JSON string
MySQL query
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
Formulaire day05
Practical multifunctional toolbox wechat applet source code / support traffic master
CSP drawing
Eh, the log time of MySQL server is less than 8h?