Shin Biao Shin Biao - 2 months ago 7
iOS Question

how to print a string contains @ and " in objective c

For example:I want to write

@"@^@"
by Objective c,but it get error.
Does anyone know how to print a string containing
@
?

Answer

You can print @"@^@" this like,

   NSLog(@"@\"@^@\"");

If you want to print " then you need to add back slash before it like, \"

Hope this will help :)