Six Handy Operations for String Processing in C++20/23 -- Bartlomiej Filipek

sixhandy-barto.pngIn this article, we’ll explore six practical string processing operations introduced in C++20 and C++23. These features represent an evolution in this crucial area, covering a spectrum of operations from searching and appending to creation and stream handling.

Six Handy Operations for String Processing in C++20/23

by Bartlomiej Filipek

From the article:

Let’s start with a simple yet long-awaited feature…

1. contains(), C++23

Finally, after decades of standardization, we have a super easy way to check if there’s one string inside the other. No need to use .find(str) != npos!

Before C++23:

sixhandy-1.png

And now, thanks to the proposal: P1679R3:
sixhandy-2.png
As you can see, the new approach with contains() is more straightforward and intuitive.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.