#1776 CSV data parser. Remove double spaces in column names

This commit is contained in:
Bjørn Erik Jensen
2018-05-23 07:48:19 +02:00
parent 660b6a6430
commit 8f5c3436ce
3 changed files with 21 additions and 2 deletions

View File

@@ -39,3 +39,20 @@ bool RiaTextStringTools::compare(const QString& expected, const QString& actual)
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaTextStringTools::trimAndRemoveDoubleSpaces(const QString& s)
{
int length;
QString trimmed = s.trimmed();
do
{
length = trimmed.size();
trimmed = trimmed.replace(" ", " ");
} while (trimmed.size() < length);
return trimmed;
}

View File

@@ -25,5 +25,6 @@ class QString;
//--------------------------------------------------------------------------------------------------
namespace RiaTextStringTools
{
bool compare(const QString& expected, const QString& actual);
bool compare(const QString& expected, const QString& actual);
QString trimAndRemoveDoubleSpaces(const QString& s);
}