In C++, to escape characters like “\n” we use an extra “\”. From C++ 11, we can use raw strings in which escape characters (like \n \t or \” ) are not processed. The syntax of raw string is that the literal starts with R”( and ends in )”.
Let’s see an example to see raw string literal in C++:
Geeks. For. Geeks. Geeks.\nFor.\nGeeks.\n
This article is contributed by MAZHAR IMAM KHAN. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Integer literal in C/C++ (Prefixes and Suffixes)
- ASCII NUL, ASCII 0 ('0') and Numeric literal 0
- Check if a string can be formed from another string using given constraints
- std::string::append vs std::string::push_back() vs Operator += in C++
- std::string::replace_copy(), std::string::replace_copy_if in C++
- std::string::replace , std::string::replace_if in C++
- std::string::remove_copy(), std::string::remove_copy_if() in C++
- string at() in C++
- Tokenizing a string in C++
- std::string::resize() in C++
- std::string::find_first_not_of in C++
- std::string::find_last_not_of in C++
- string find in C++
- std::string::erase in C++
- std::string::push_back() in C++
Improved By : Akanksha_Rai