startswith: 用于检测字符串是否以指定的前缀开始。 语法: public boolean startswith(string prefix, int toffset) 或 public boolean startswith(string prefix) prefix – 前缀。 toffset – 字符串中开始查找的位置。 例如: line.startswith('[') x.rstrip().lstrip() str.rstrip(