?
Solved

TheLearnedOne (Bob) : Our First Genius

Posted on 2006-07-13
6
Medium Priority
?
366 Views
Last Modified: 2010-05-18
For 200 points to put you over ... How do I get an integer from a string (i.e. I have "45" in a textbox)

:D

I think we all know that points aren't that important to you but congratulations on being our first genius!

Cheers,

Greg Young
0
Comment
Question by:gregoryyoung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:PoeticAudio
ID: 17099944
ooh... ooh! I know this one... um... it's something like

something like:

string str = "";
int txtLen = textBox1.Text.Length;

foreach(char c in textBox1.Text.ToCharArray(0, txtLen ))
{
      str += c;
}
                  
char[] ints = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};

foreach(char c in str.ToCharArray())
{
      if(Array.IndexOf(ints, c) < 0)
      {
            MessageBox.Show("Not a valid int");
            return;
      }
}

//valid if it makes it this far
int i = Convert.ToInt32(Convert.ToString(Convert.ToString(str.ToString()).ToString().ToString()).ToString());

-=)

Ah, just kidding, Congrats Bob!!!
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 17101032
Good job Bob!   =)
0
 
LVL 9

Expert Comment

by:WinterMuteUK
ID: 17101041
Just wanna add my congrats too!
Great work mate!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 17102152
Hey, Greg, I have a question open about serialization, and I know that you know a lot about the subject, and I would like to hear what you have to say.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21917355.html

P.S.  I'll take my points the good ol' fashion way, if you don't mind.  One more question and I am home free for genius #3.  These people around here are driving me crazy, though, cuz I have posted a lot of suggestions and good comments, but it is sooo quiet today, it just creeps up to just below 1000000.

Bob
0
 
LVL 44

Expert Comment

by:bruintje
ID: 17106854
Congrats Bob,

a good excuse to thank you for all the cleanup you're doing as an aside :)

Brian
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 80 total points
ID: 17107572
Aah, yes, thank you Brian for recognizing the need for cleanup--it's a tough job, but somebody has to do it!!! *BIG GRIN*

Bob
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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