Why would you care? Wouldn't the simplest solution be to just strip whitespace in whatever function that receives the password when used? If you know that your passwords are only [A-Za-z0-9], strip everything else. This way you can present the code to the user grouped however you like; dots, dashes, spaces, exclamation marks, poop-emojis...