約128,000件1ページ目

日本語のみで絞り込む

2012/5/10 -You can use erase for removing symbols: str.erase(start_position_to_erase, number_of_symbols);. And you can use find to find the starting ...

Erases the portion of the string value that begins at the character position pos and spans len characters (or until the end of the string, if either the content ...

Each time the steps are the same: find the index of the beginning of the pattern you want to remove, then call erase on that index for the next n characters, ...

2026/5/26 -The string::erase() function in C++ is a built-in function of the string class that is used to remove characters from a string.

2026/9/18 -How to Replace a Substring in a C++ String. Short answer: find the position with find() , then call replace(pos, length, newText) .

2018/5/9 -Another approach is to use std::find, which uses iterators instead of indices, and the iterator version of std::string::erase. This slightly ...

2025/8/6 -The .erase() method is a built-in member function of the C++ string class that removes characters from a string object.

1) Removes std::min(count, size() - index) characters starting at index . · 2) Removes the character at position . If position is not a dereferenceable iterator ...

2024/6/18 -Case and point — replacing all occurrences of a substring with another string. An algorithm that is easy to screw up, if you approach it in an ...

The most direct way to trim characters from the end of a `std::string` is to use `erase()` combined with `find_last_not_of()`. This lets you cut off spaces, ...