In this C++ tutorial, you will get an introduction to strings in C++ programming language. There are also a list of tutorials that get you started with the basics of strings, and then cover the most commonly used string operations.

C++ String

In C++, String is an object of class type std::string. This type of object represents a sequence or string of characters, hence called a string.

The following is an example for a string.

</>
Copy
"Hello World"

This string contains 11 characters. In C++, the string constant is enclosed in double quotes.

string keyword is used to specify the datatype of a variable.

</>
Copy
string s = "Hello World";

In this tutorial, we will go through most used C++ String Operations with examples.

C++ String Tutorials

The following are tutorials based on string operations, and are categorized based on the type of operations done at string level, or character level.

Conversions

The following tutorials cover use cases like converting given string into other datatypes, or vice versa.

Conclusion

In this C++ Tutorial, we learned how to do some of the String Operations with the help of example programs and detailed tutorials.