You can now do this in-place with either of these two options:
string.retain(|c| c != '\n')
or (nightly only)
string.remove_matches('\n');
Check out this playground to see it working
You can now do this in-place with either of these two options:
string.retain(|c| c != '\n')
or (nightly only)
string.remove_matches('\n');
Check out this playground to see it working