Like Tree3Likes
  • 3 Post By laserlight

Dissecting a string to grab a number.

This is a discussion on Dissecting a string to grab a number. within the C++ Programming forums, part of the General Programming Boards category; I have the line: "System.Windows.Forms.Button, Text: 6" and I want to pull out the 6 into a variable X to ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    3

    Dissecting a string to grab a number.

    I have the line:

    "System.Windows.Forms.Button, Text: 6"
    and I want to pull out the 6 into a variable X to use in a like like:

    textBox1->Text = Convert::ToString(X);

    It was so easy in VB (-:
    Last edited by Emerogork; 12-29-2011 at 12:12 AM. Reason: to make it more prittier.

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,522
    It's simple in C++ too.
    FAQ - Cprogramming.com

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    3
    Quote Originally Posted by whiteflags View Post
    It's simple in C++ too.
    FAQ - Cprogramming.com
    You don't know either?

  4. #4
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,522
    I linked you to the FAQ of the parent site. Are you going to make me do it for you or are you going to make an attempt to do it yourself? If you read the FAQ about converting a string to an int, you should have a good place to start. Stringstreams can parse the most complex strings if you think about what you're doing.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    3

    Nuff said,...

    Quote Originally Posted by whiteflags View Post
    I linked you to the FAQ of the parent site. Are you going to make me do it for you or are you going to make an attempt to do it yourself? If you read the FAQ about converting a string to an int, you should have a good place to start. Stringstreams can parse the most complex strings if you think about what you're doing.
    Yea, I was told that this site is nothing more than a Fallon Saturday Night Live skit.. Its ok, I will go where there are users that are willing to be supporting..

  6. #6
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,522
    What more do you want from me?

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,968
    Quote Originally Posted by Emerogork
    I will go where there are users that are willing to be supporting.
    You want to go to a place where people will spoon feed you like a baby? Excellent! Good riddance

    *thread closed*
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 03-07-2011, 12:24 AM
  2. Dissecting an Excel XML spreadsheet
    By desmond5 in forum C++ Programming
    Replies: 1
    Last Post: 05-22-2008, 04:32 PM
  3. Dissecting numbers
    By jmajeremy in forum C++ Programming
    Replies: 19
    Last Post: 01-03-2007, 09:17 PM
  4. grab rgb
    By dP munky in forum Tech Board
    Replies: 4
    Last Post: 04-04-2003, 11:39 AM
  5. Dissecting a string...
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-18-2001, 06:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21