Create strlower() function to convert std::string to lowercase.

This commit is contained in:
Rogier 2015-12-21 20:33:08 +01:00
parent 333eded9f3
commit df9a03f416

16
util.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef _UTIL_H_
#define _UTIL_H_
#include<cstring>
inline std::string strlower(const std::string &s)
{
int l = s.length();
std::string sl = s;
for (int i = 0; i < l; i++)
sl[i] = tolower(sl[i]);
return sl;
}
#endif // _UTIL_H_