Create string_is_empty

This commit is contained in:
twinaphex 2015-04-06 19:03:14 +02:00
parent 85c48f0c3d
commit d880ffab5b
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,8 @@
extern "C" {
#endif
bool string_is_empty(const char *data);
char *string_replace_substring(const char *in, const char *pattern,
const char *by);

View File

@ -22,6 +22,19 @@
#include <string/stdstring.h>
bool string_is_empty(const char *data)
{
char **str = NULL;
if (!data)
return true;
str = (char**)&data;
if (**str == '\0')
return true;
return false;
}
char *string_replace_substring(const char *in, const char *pattern, const char *replacement)
{
char *needle = NULL;