python在字符串中查找子字符串,如果找到则返回子字符串的位置,如果没有找到则返回-1
S = 'xxxxSPAMxxxxSPAMxxxx' where = S.find('SPAM') # search for position print where # occurs at offset 4
python在字符串中查找子字符串,如果找到则返回子字符串的位置,如果没有找到则返回-1
S = 'xxxxSPAMxxxxSPAMxxxx' where = S.find('SPAM') # search for position print where # occurs at offset 4