Answer the question
In order to leave comments, you need to log in
How to find out if a string ends with a '~' character?
How can I find out if a string ends with a '~' in C?
Answer the question
In order to leave comments, you need to log in
For example:
bool endsWith (char* base, char* str) {
int blen = strlen(base);
int slen = strlen(str);
return (blen >= slen) && (0 == strcmp(base + blen - slen, str));
}
Far from si, but I think like this:
char string[size];
...
if (string[strlen(string)-1] == '~') {
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question