about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-28 15:37:04 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-28 15:37:04 -0400
commit765d30847505c24ea428de8bdd0d63e21a130e94 (patch)
tree2230c31521c27a6420061fdc0c660e58808eddcc
parent7de18ffaa7545543eec5db3c557e1a7fdb9115f2 (diff)
downloadhkutil-765d30847505c24ea428de8bdd0d63e21a130e94.tar.gz
hkutil-765d30847505c24ea428de8bdd0d63e21a130e94.tar.bz2
hkutil-765d30847505c24ea428de8bdd0d63e21a130e94.zip
Added lowercase function
-rw-r--r--hkutil/string.h16
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,