Skip to tool

C++ std::string::size() Online

Return the length of text input.

The output updates as you type. The tool processes input in your browser.

Worked example

A visual character can contain multiple Unicode code points. Compare the text length and UTF-8 byte count when validating a storage limit.

Sample input
manuals.plus
Sample output
12

Using this operation in C++

The interactive result uses JavaScript. std::string operates on char elements. With UTF-8 data, byte offsets and decoded character positions can differ.

C++ reference