473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# how to distinguish whether input is char string or return key pressed

1
I am prompting the user for name

if he/she returns non empty string
validate the input string
it should contain only alphabets
no special characters or numbers
else if he/she enters Quit
quit the program
else if he/she just presses return key
quit the program

Plz help
how to do all the above
Feb 1 '08 #1
3 3681
debasisdas
8,127 Expert 4TB
Thread moved to .net forum from articles section.
Feb 1 '08 #2
r035198x
13,262 8TB
I am prompting the user for name

if he/she returns non empty string
validate the input string
it should contain only alphabets
no special characters or numbers
else if he/she enters Quit
quit the program
else if he/she just presses return key
quit the program

Plz help
how to do all the above
What have you done so far?
Feb 1 '08 #3
Plater
7,872 Expert 4TB
This sounds a lot like an assignment, which is a no no.
And if I am right, then you should have gotten some basic material that covers how you would do this.
Feb 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Scott Shaw | last post by:
Hi all, I was wondering if you could help out with this problem that I am having. What I am trying to do is detect keyboard input in a while loop without halting/pausing the loop until the key is...
9
by: kernelxu | last post by:
hi,everybody. I calling function setbuf() to change the characteristic of standsrd input buffer. some fragment of the progrem is: (DEV-C++2.9.9.2) #include <stdio.h> #include <stdlib.h> int...
8
by: ais523 | last post by:
I use this function that I wrote for inputting strings. It's meant to return a pointer to mallocated memory holding one input string, or 0 on error. (Personally, I prefer to use 0 to NULL when...
2
by: pelletier.thomas | last post by:
Hello everybody. I'm trying to code a very little OS. But I have a problem with the keyboard input: It show thechar + "~" :s Can you help me ? The source is there :...
7
by: Simon | last post by:
I'm trying to find some nice, concise code that asks the user for their name and then stores it. I'd like it to behave as follows: 1. The user can type in up to 12 letters or numbers 2. Once 12...
17
by: Ron | last post by:
I want to write a program that will accept a number in a textbox for example 23578 and then in a label will display the sum of the odd and even number like this... the textbox containsthe number...
4
by: Jules | last post by:
I am trying to understand the behavior of a short program. Hopefully someone can tell me what's going on. The program I wrote is: #include <stdio.h> main() { char c; while(1)
0
by: Terry Reedy | last post by:
rishi pathak wrote: Does not work on Windows, at least with 3.0, as tty fails trying to import termios. There, use msvcrt module "msvcrt.kbhit() Return true if a keypress is waiting to be...
27
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I have a fully-portable C program (or at least I think I do). It works fine on Windows, but malfunctions on Linux. I suspect that there's something I don't know about the standard input stream...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.