diff options
| -rw-r--r-- | hkutil/string.h | 16 |
1 files changed, 16 insertions, 0 deletions
| diff --git a/hkutil/string.h b/hkutil/string.h index f8264ac..a8cafc6 100644 --- a/hkutil/string.h +++ b/hkutil/string.h | |||
| @@ -25,6 +25,22 @@ namespace hatkirby { | |||
| 25 | return result; | 25 | return result; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | inline std::string lowercase(std::string in) | ||
| 29 | { | ||
| 30 | std::string result; | ||
| 31 | |||
| 32 | std::transform( | ||
| 33 | std::begin(in), | ||
| 34 | std::end(in), | ||
| 35 | std::back_inserter(result), | ||
| 36 | [] (char ch) | ||
| 37 | { | ||
| 38 | return std::tolower(ch); | ||
| 39 | }); | ||
| 40 | |||
| 41 | return result; | ||
| 42 | } | ||
| 43 | |||
| 28 | template <class InputIterator> | 44 | template <class InputIterator> |
| 29 | std::string implode( | 45 | std::string implode( |
| 30 | InputIterator first, | 46 | InputIterator first, |
