mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1776 CSV data parser. Remove double spaces in column names
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user