0

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!

gtlambert
  • 11,711
  • 2
  • 30
  • 48
eshi
  • 57
  • 7

1 Answers1

1

Casting to str and then checking should work

str(QString).isalnum()
pgrzesik
  • 1,869
  • 13
  • 14