Skip to content

Commit a615036

Browse files
author
thk123
committed
Correcting comment on strip_strings and moving to doxygen
1 parent 946411c commit a615036

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/util/string_utils.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Author: Daniel Poetzl
1212
#include <cctype>
1313
#include <algorithm>
1414

15-
/// Remove all whitespace characters from the end of a string. Whitespace
15+
/// Remove all whitespace characters from either end of a string. Whitespace
1616
/// in the middle of the string is left unchanged
1717
/// \param s: the string to strip
1818
/// \return The stripped string
@@ -34,6 +34,16 @@ std::string strip_string(const std::string &s)
3434
return s.substr(i, (j-i+1));
3535
}
3636

37+
/// Given a string s, split into a sequence of substrings when separated by
38+
/// specified delimiter.
39+
/// \param s: The string to split up
40+
/// \param delim: The character to use as the delimiter
41+
/// \param [out] result: The sub strings
42+
/// \param strip: If true, strip_string will be used on each element, removing
43+
/// whitespace from the beginning and end of each element
44+
/// \param remove_empty: If true, all empty-string elements will be removed.
45+
/// This is applied after strip so whitespace only elements will be removed if
46+
/// both are set to true
3747
void split_string(
3848
const std::string &s,
3949
char delim,

src/util/string_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ std::string strip_string(const std::string &s);
1818

1919
void split_string(
2020
const std::string &s,
21-
char delim, // must not be a whitespace character if strip is enabled
21+
char delim,
2222
std::vector<std::string> &result,
23-
bool strip = false, // strip whitespace from the end of elements
24-
bool remove_empty = false); // remove empty elements
23+
bool strip = false,
24+
bool remove_empty = false);
2525

2626
void split_string(
2727
const std::string &s,

0 commit comments

Comments
 (0)