c remove last character from a string

C
#include <string.h>
str[strlen(str)-1] = '\0';pame

Source

Also in C: