Improve compliance when printing drive labels
This commit is contained in:
parent
508d338c27
commit
c7484ceaaa
5 changed files with 31 additions and 8 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <assert.h>
|
||||
#include <cctype>
|
||||
#include <ctype.h>
|
||||
#include <functional>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -51,6 +52,15 @@ void trim(std::string &str) {
|
|||
if (loc != std::string::npos) str.erase(loc+1);
|
||||
}
|
||||
|
||||
void strip_punctuation(std::string &str) {
|
||||
str.erase(
|
||||
std::remove_if(
|
||||
str.begin(),
|
||||
str.end(),
|
||||
[](unsigned char c){ return std::ispunct(c); }),
|
||||
str.end());
|
||||
}
|
||||
|
||||
/*
|
||||
Ripped some source from freedos for this one.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue