I'm trying to create code that will take text input, eliminate all whitespace characters (left and right, not those between characters) and then validate if the string has following format: 'XXX XXX' (where X is letter or digit). If it doesn't (say that it has XXX-XXX or XXXXXX format) it would convert it to such format.
I know that I can use strip to remove whitespace from a string. I also know how to check the length of a string and how to convert it, but I don't know how to validate a string after using .strip().
re).