I'd like double quotes to appear within the following string so it looks like:
"hi there == "
Here's the code I'm using:
NSMutableString *s = [[NSMutableString alloc] init];
[s appendString:@""""];
[s appendString:@"hi there == ""\n\r"];
Instead I only get:
hi there ==
Any ideas?
There are scenarios where you need to escape double quotes already present in the String. This generally happens while dealing with JSON file format or reading file data. Double quotes characters can be escaped with backslash ( \) in java.
The old Access version 'knows' that when a double quote character appears in the middle of a string, it needs to be escaped, i.e., displayed as "", so as not to be mistaken for the ending string delimiter, but I can not reproduce this desired behaviour in the SSIS version.
You can escape double quotes (or any special character) using a slash ( \ ) const slashEscape="It was the last step."Stop!". She shouted." Inside a template literal, you don't have to escape single or double-quotes. const templateLiteral=`"I'm OK with this Agreement" Said he. "Me too!". I said.`
Put the escaping character before the single quote in the string. You can use the first solution like this: In Python, the backslash is an escaping character. So you can use it like the below: Now suppose you have to print the below line: She said, “You are looking nice”. And I smiled print ("She said, "You are looking nice". And I smiled")
[s appendString:@"hi there == \"\n\r"];
\"
is what is needed for "
- This is standard C formatting.
Although Its late but we can Try this:
[NSString stringWithFormat:@"\"Hi There=\" Other text"];
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