Identifying a period at the end of a string

dusty (19)
I want to end a loop if a string ends with a period. A period in any other place should not end the string. How can this be achieved? I know how to find a period within a string, but can't figure out how to determine if the period is the last character. Any tips would be greatly appreciated.
Athar (4383)
if (!str.empty() && str[str.length()-1]=='.') ...
dusty (19)
Thanks, I will give that a try
Registered users can post here. Sign in or register to post.