This link says that:
The @ symbol tells the string constructor to ignore escape characters and line breaks.
I try to append contain in StringBuilder like this.
   StringBuilder sb = new StringBuilder();
   sb.Append(@"<test name="test_all">");
But it gives an error in test_all.
I got a solution for this using single quotes. ' ':
sb.Append("<test name='layout_all'>");
But I don't understand as per document why " " does not work. Or am I missing something to understand?
Explanation: Given string contains alphabets, number, and special characters.
We can print the string using %s format specifier in printf function. It will print the string from the given starting address to the null '\0' character.
The strchr() function finds the first occurrence of a character in a string. The character c can be the null character (\0); the ending null character of string is included in the search. The strchr() function operates on null-ended strings.
Well, " still has a special meaning in a verbatim string literal - you need to escape it, but in this case, you simply double it:
sb.Append(@"<test name=""test_all"">");
                        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