eshi
eshi

Reputation: 57

Python: use of isalnum() method in QString

I'm trying to check if the user's input is alphanumeric. I tried using isalnum but it always shows this error:

AttributeError: 'QString' object has no attribute 'isalnum'

what would be the best way to know if a string is alphanumeric in QString? Thank you!

Upvotes: 0

Views: 415

Answers (1)

pgrzesik
pgrzesik

Reputation: 2427

Casting to str and then checking should work

str(QString).isalnum()

Upvotes: 1

Related Questions