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.

"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.

string s = "Hello World";

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

C++ String Tutorials

Basics

Checks

Manipulations

The following tutorials cover use cases where part or whole of the string value is manipulated.

The following tutorials cover use cases like accessing or removing characters at specific index in the string.

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.