how to remove the last character of a string in c code example Example: c remove last character from a string #include <string.h> str[strlen(str)-1] = '\0';