?
Solved

String = Int

Posted on 2006-04-04
1
Medium Priority
?
235 Views
Last Modified: 2012-05-05
What would it take to validate if a string datatype can be an Int datatype?
0
Comment
Question by:thenrich
1 Comment
 
LVL 3

Accepted Solution

by:
osmantemiz earned 200 total points
ID: 16372683
I think this will help:

bool isInt(string s)
{
  int k=0;
  try
  {
     k = int.Parse(s);
  }
  catch
  {
     return false;
  }

  return true;
}
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question