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

ParameterDescription
baseThe 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