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

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


Find / Get / Access



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

Character Level Manipulations


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


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