python there a quick way to determine the beginning of the end

1, the beginning of the judgment: 

String.startsWith ( " objective character ")

2, it is determined at the end:

string.endswith ( " objective character ")

return 

True  or  False

Also, suggesting that first time, remove the string and trailing spaces, the method prior to determination:

string.strip()

Guess you like

Origin www.cnblogs.com/smarttony/p/12016759.html