mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
add remove_extra_whitespace() to libpbd
This commit is contained in:
parent
bd9fe31778
commit
5563117a1b
2 changed files with 10 additions and 1 deletions
|
|
@ -16,6 +16,8 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
#include <algorithm>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "pbd/whitespace.h"
|
||||
|
||||
|
|
@ -77,4 +79,11 @@ strip_whitespace_edges (string& str)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
remove_extra_whitespace (string const & input, string & output)
|
||||
{
|
||||
std::unique_copy (input.begin(), input.end(), std::back_insert_iterator<string>(output), [](char a,char b){ return isspace(a) && isspace(b);});
|
||||
}
|
||||
|
||||
|
||||
} // namespace PBD
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue