function to check the last element of a string in c++ code example Example: how to find last character of string in c++ String[strlen(String) - 1];