Skip to content

Commit 0881bf2

Browse files
author
Daniel Kroening
committed
split_string with return value now also has 'strip' and 'remove_empty'
1 parent f0221b8 commit 0881bf2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/util/string_utils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ void split_string(
116116
right=result[1];
117117
}
118118

119-
std::vector<std::string> split_string(const std::string &s, char delim)
119+
std::vector<std::string> split_string(
120+
const std::string &s,
121+
char delim,
122+
bool strip,
123+
bool remove_empty)
120124
{
121125
std::vector<std::string> result;
122-
split_string(s, delim, result);
126+
split_string(s, delim, result, strip, remove_empty);
123127
return result;
124128
}
125129

src/util/string_utils.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ void split_string(
3030
std::string &right,
3131
bool strip=false);
3232

33-
std::vector<std::string> split_string(const std::string &s, char delim);
33+
std::vector<std::string> split_string(
34+
const std::string &s,
35+
char delim,
36+
bool strip = false,
37+
bool remove_empty = false);
3438

3539
std::string trim_from_last_delimiter(
3640
const std::string &s,

0 commit comments

Comments
 (0)