From: "studlee2@..." Date: 2006-07-11T03:40:05+09:00 Subject: Re: Real newbie question about methods You can add a regular expression to see if you age is valid like this: /-----------------------------------------------------------------/ valid = /\d{2}/ #checks for exactly 2 digits if valid.match(age) else puts "Invalid entry" end /-----------------------------------------------------------------/ Hope this helps. _Steve simonh wrote: > Thanks Une b�vue > > It seems I didn't need the parameter to the method. Also forgot to add > the second elsif (to check if too old). If I run the program and type > 'a' instead of a two digit number the first if statement gets printed - > 'sorry too young' > > what i want is for the else statement to be run if user input is not > entered as two digits. How would I do this? Somehow got to check if > gets recieves an integer of two digits. > > thanks again