天天看点

python str.endswith

判断字符串是否以指定后缀结尾,如果以指定后缀结尾返回True,否则返回False

suffix -- 该参数可以是一个字符串或者是一个元素。

start -- 字符串中的开始位置。

end -- 字符中结束位置。

endswith(...)

    S.endswith(suffix[, start[, end]]) -> bool

    Return True if S ends with the specified suffix, False otherwise.

    With optional start, test S beginning at that position.

    With optional end, stop comparing S at that position.

    suffix can also be a tuple of strings to try.