quoted in C++
The quoted function in C++ is used to insert and extract quoted strings with embedded space.
Syntax of quoted
quoted(const CharT* s, CharT delim = CharT(' " '), CharT escape = CharT('\\'));
Here,
- s: String to be printed.
- delim: Character to be used as delimiter.
- escape: Character to be used as escape sequence.
Example of quoted
C++
// C++ program to illustrate the use of quoted #include <iomanip> #include <iostream> #include <string> using namespace std; // driver code int main() { string str = "Hello World!" ; cout << "Original string: " << str << endl; // output string using quoted cout << "String after quoted : " << quoted(str) << endl; return 0; } |
Original string: Hello World! String after quoted : "Hello World!"
< iomanip > Header in C++
In C++, the <iomanip> header file defines the manipulator functions that are used to manipulate the format of the input and output of our program. It is a part of the input/output library in C++. In this article, we will discuss the functions and facilities provided in the <iomanip> header file in C++ with examples.