I have to initialize string as "Rose" including Quotation Mark. How to write " in our string?
Once a string has been initialized using NSString, the only way to append text to the string is to create a new NSString object. While doing so, you can append string constants, NSString objects, and other values.
A static, plain-text Unicode string object which you use when you need reference semantics or other Foundation-specific behavior.
If you create an object using a method that begins with init, new, copy, or mutableCopy, then you own that object and are responsible for releasing it (or autoreleasing it) when you're done with it. If you create an object using any other method, that object is autoreleased, and you don't need to release it.
Essentially, there is no difference between string and String (capital S) in C#. String (capital S) is a class in the . NET framework in the System namespace. The fully qualified name is System.
Escape the double quote with \
NSString *yourString = @"\"Rose\"";
Use the escape character: \
NSString *r = @"\"Rose\"";
You can find additional information about Escape character and String literal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With