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