What is the difference between string and nsstring?



What is the difference between string and nsstring?..

Answer / Parvez Aalam

In Objective-C, both String and NSString are used to represent text. However, they have some differences:
1. String: It is a C-based Foundation framework class, which is not object-oriented and has no methods or properties for common string operations like length, substring, etc. On the other hand, it is more efficient due to being C based.
2. NSString: It is an Objective-C runtime class, which provides many useful string handling capabilities such as conversion, comparison, searching, and mutation. However, it is less efficient than String because it is object-oriented.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

Is objective c type safe?

1 Answers  


What is objective c programming used for?

1 Answers  


Explain mutable types in objective c programming language?

1 Answers  


What is objective c and swift?

1 Answers  


What is meant by not thread safe?

1 Answers  


What is the difference between method and type?

1 Answers  


What is inheritance in objective c?

1 Answers  


Is struct a class?

1 Answers  


What is difference between objective c and c?

1 Answers  


What is abstract class in objective c?

1 Answers  


Is objective c faster than swift?

1 Answers  


What are the size classes?

1 Answers  


Categories