I am attempting to write a program where when a user enters a word in a text box the program will display the word entered, the number of characters the word is, and what the first and last letters are of the word. The problem I'm having is when someone enters two words, the program is supposed to display an error telling them to enter one word only. What my program does though is it still acts as if it is one word. For example, if some one enters, Hell o, it still says the word is Hello with 6 characters, 1st letter H, last letter O.
What I have tried:
I have tried to have the program search for a space using the ascii character code 32, but it seems to just ignore if there is a space or not.