diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-18 13:25:27 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-18 13:25:27 +0200 |
| commit | 24316f2e717237d754c6b1ce75be024e4ef34edb (patch) | |
| tree | 6590ed660ff9334ec2dd10d794106913a78cbf33 /src/helpers/MiscFunctions.cpp | |
| parent | 655c0384179f3a72132784bb85f0d722231b8e11 (diff) | |
Fix trailing spaces in config
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index a3aa7871..63751781 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -61,4 +61,16 @@ void scaleBox(wlr_box* box, float scale) { box->height = std::round((box->y + box->height) * scale) - std::round(box->y * scale); box->x = std::round(box->x * scale); box->y = std::round(box->y * scale); +} + +std::string removeBeginEndSpacesTabs(std::string str) { + while (str[0] == ' ' || str[0] == '\t') { + str = str.substr(1); + } + + while (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t') { + str = str.substr(0, str.length() - 1); + } + + return str; }
\ No newline at end of file |
