当前位置:网站首页>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];边栏推荐
- Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
- [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
- 150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
- [PaddleSeg 源码阅读] PaddleSeg Transform 的 Normalize操作
- Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
- Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
- What are the virtual machine software? What are their respective functions?
- Don't disagree, this is the most powerful "language" of the Internet
- Apple submitted the new MAC model to the regulatory database before the spring conference
- How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
猜你喜欢

Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi

Consul of distributed service registration discovery and unified configuration management

Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!

Unity knapsack system (code to center and exchange items)

Rhcsa day 2

Setting methods, usage methods and common usage scenarios of environment variables in postman
![Backpropagation formula derivation [Li Hongyi deep learning version]](/img/ef/f76eae39c4f8716a0030a60c85b09c.gif)
Backpropagation formula derivation [Li Hongyi deep learning version]

Setting methods, usage methods and common usage scenarios of environment variables in postman

If you have just joined a new company, don't be fired because of your mistakes

This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
随机推荐
If you have just joined a new company, don't be fired because of your mistakes
Rhcsa day 3
Contest3145 - the 37th game of 2021 freshman individual training match_ D: Ranking
Have you entered the workplace since the first 00???
Don't disagree, this is the most powerful "language" of the Internet
Leetcode51.n queen
Monitoring - Prometheus introduction
Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches
Apple submitted the new MAC model to the regulatory database before the spring conference
96% of the collected traffic is prevented by bubble mart of cloud hosting
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
Jenkins continuous integration environment construction V (Jenkins common construction triggers)
Résumé des outils communs et des points techniques de l'examen PMP
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
Explain AI accelerator in detail: why is this the golden age of AI accelerator?
The property of judging odd or even numbers about XOR.
Zigzag scan
Value transfer communication between components (parent to child, child to parent, brother component to value)