That code doesn't intelligently parse anything, just removes dots if they are in the end of the string. For some reason stripping feels more appropriate name for such an action.