0

My son was trying his hands on codes writings to a lttle windows application, the he realised he would like to set a condition as to how many characters or a limitation on the leght of string input from the user, cos without a limitation the user might write a long lenghty name , and so on.
can anyone help os with how to write an example of set conditions to inputs from the user.

e.g. if we write(this is just a pseaudo code)

Console.Writeline (" Player enter your name and press enter");
String name = Console.ReadLine();

if name...........
&& string.Lenght ...........
accept
else
throw exception.
hope there will be some help.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by asafoatse
0

okay, thanks for saving me, my son is now glad . thanks ddanbee

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.