numpy.core.defchararray.chararray.index

chararray.index(sub, start=0, end=None)[source]

find,但在找不到子字符串时引发ValueError

也可以看看

char.index