diff --git a/src/Mayaqua/Str.c b/src/Mayaqua/Str.c index 7a1c79c0..95cc515a 100644 --- a/src/Mayaqua/Str.c +++ b/src/Mayaqua/Str.c @@ -2412,6 +2412,33 @@ void TrimCrlf(char *str) } } +// Remove quotes at the beginning and at the end of the string +void TrimQuotes(char *str) +{ + UINT len = 0; + // Validate arguments + if (str == NULL) + { + return; + } + + len = StrLen(str); + if (len == 0) + { + return; + } + + if (str[len - 1] == '\"') + { + str[len - 1] = 0; + } + + if (str[0] == '\"') + { + Move(str, str + 1, len); + } +} + // Remove white spaces of the both side of the string void Trim(char *str) { diff --git a/src/Mayaqua/Str.h b/src/Mayaqua/Str.h index 7a554706..cb8c1e06 100644 --- a/src/Mayaqua/Str.h +++ b/src/Mayaqua/Str.h @@ -155,6 +155,7 @@ bool ToBool(char *str); int ToInti(char *str); void ToStr(char *str, UINT i); void TrimCrlf(char *str); +void TrimQuotes(char *str); void Trim(char *str); void TrimRight(char *str); void TrimLeft(char *str);