Defined in header <cparse/Generator.hh>
virtual std::string removeNonAlphanums( std::string const& base ) const noexcept;
Returns a copy of base with every byte for which std::isalnum returns false dropped from the output.
Implemented via std::copy_if — no substitute character, no placeholder.
Parameters
| Parameter | Description |
|---|---|
base | The input string. Not mutated. |
Return value
A new string of length equal to the alphanumeric-byte count in base.
Exceptions
noexcept.
Notes
Byte-oriented, same locale caveat as replaceNonAlphanums.
Example
removeNonAlphanums("foo.bar-baz_123") // → "foobarbaz123"
See also
- Generator::replaceNonAlphanums — the replace-instead-of-drop variant.

