int truncate(char *s, int n){
    if (strlen(s) <= n){
        return 0;
    }
    else{
        s[n] = "\0";
        int result = strlen(s) - n;
        return result;
    }
}

s[n] = "\0" is not working