Jump to content

password question

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
syntaxError

syntaxError

    Newbie

  • Members
  • Pip
  • 9 posts
Hello all. I doing my homework and have this question that I can seem to figure it out so please help out. ok oh... the HW problem is to allow user to enter a password in between 8 to 15 characters and I did just that but whenever a user enter a space and click enter, a messageBox should appear and said it wrong because there should not be a space. How can you make sure that when there is a space, it is wrong. I try using the contains methods but no luck. any help would be appreciated!

#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Just do a few expressions on the inputted string. Either replace all the spaces out and compare it to the original string, or something. If it is not the same alert the user for being stupid.

Can you show us the code you have now?