mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(string): add SStrLower
This commit is contained in:
parent
936dd2158b
commit
320f5f1add
3 changed files with 35 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "storm/Error.hpp"
|
||||
#include "storm/Memory.hpp"
|
||||
#include "storm/string/bjhash.hpp"
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
#include <strings.h>
|
||||
|
||||
|
|
@ -220,6 +221,14 @@ size_t SStrLen(const char* string) {
|
|||
return c - string;
|
||||
}
|
||||
|
||||
void SStrLower(char* string) {
|
||||
char* tmp = string;
|
||||
|
||||
for (; *tmp; tmp++) {
|
||||
*tmp = static_cast<char>(tolower(*tmp));
|
||||
}
|
||||
}
|
||||
|
||||
const char* SStrStr(const char* string, const char* search) {
|
||||
STORM_ASSERT(string);
|
||||
STORM_ASSERT(search);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue