TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
HASH
NA
1
1.6k
lexical analyzer
Mar 18 2013 11:34 AM
here is my code can anyone please tell me what should i put to convert the user input string so it could go through a check by switch statement i am stuck here
static void Main(string[] args)
{
Console.WriteLine("ENTER string:");
string str = (Console.ReadLine();
switch (str)
{
case "keyword":
string[] kw = new string[2]{ "for","while"};
Console.WriteLine("\n\nkeyword");
Console.WriteLine(kw.Contains(str));
Console.ReadLine();
goto case "punctuation";
case "punctuation":
string[] punc = new string[2]{ ";","."};
Console.WriteLine("\n\npunctuation");
Console.WriteLine(punc.Contains(str));
Console.ReadLine();
goto default;
default:
Console.WriteLine("\n\ninvalid string");
break;
}}
Reply
Answers (
0
)
save data in percentage format
foreign key