当前位置:网站首页>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];边栏推荐
- Zlmediakit compilation and webrtc push-pull flow testing
- Recent learning fragmentation (14)
- Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
- Typical applications of minimum spanning tree
- 基於.NetCore開發博客項目 StarBlog - (14) 實現主題切換功能
- Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
- Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
- This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
- What are the virtual machine software? What are their respective functions?
- (practice C language every day) pointer sorting problem
猜你喜欢

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

150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan

Package details_ Four access control characters_ Two details of protected

What is cloud primordial?

Monitoring - Prometheus introduction

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?

Tsinghua University product: penalty gradient norm improves generalization of deep learning model

Li Chuang EDA learning notes IX: layers

Third party login initial version

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
随机推荐
WP collection plug-in free WordPress collection hang up plug-in
Record a problem that soft deletion fails due to warehouse level error
Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
[latex] production of complex tables: excel2latex and detail adjustment
Leetcode51.n queen
Experience summary of the 12th Blue Bridge Cup (written for the first time)
How to use STR function of C language
Want to do something in production? Then try these redis commands
2006 translation
I stepped on a foundation pit today
MySQL is dirty
Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
SQL injection (1) -- determine whether there are SQL injection vulnerabilities
深入浅出对话系统——使用Transformer进行文本分类
Practical multifunctional toolbox wechat applet source code / support traffic master
What are the virtual machine software? What are their respective functions?
Which product is better if you want to go abroad to insure Xinguan?
【.NET+MQTT】.NET6 環境下實現MQTT通信,以及服務端、客戶端的雙邊消息訂閱與發布的代碼演示
Value transfer communication between components (parent to child, child to parent, brother component to value)
[.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client