efficiently checking that string consists of one character in Python

后端 未结 8 1336
太阳男子
太阳男子 2020-11-29 01:03

What is an efficient way to check that a string s in Python consists of just one character, say \'A\'? Something like all_equal(s, \'A\')

8条回答
提交回复
热议问题