Modifying operations

There are a few modifying operations that a string view can perform. Some of these are unique to string views only. Let's check them out.

The call stringView.swap(stringView2) swaps the content of the two string views. The methods remove_prefix and remove_suffix are unique to a string view because a string supports neither. remove_prefix shrinks its start forward; remove_suffix shrinks its end backward.

Get hands-on with 1000+ tech skills courses.