locked
How to parse integer from a string in windows store app

    Question

  • How to parse integer from a string in windows store app
    Monday, November 26, 2012 12:55 PM

Answers

All replies

  • You can use int n = _wtol( string->Data() ), to get the integer from a string.

    Monday, November 26, 2012 4:53 PM
  • hi,

    the above  function will give first integer only.I need all the ingers from a string.

    string^ = wer 12 : 34: 56 am"

    how to find all integers from this string..Is it have any simple methodes.

    Regards,

    Bilaal s


    • Edited by Bilaal John S Friday, October 04, 2013 7:15 AM Sentence
    Tuesday, November 27, 2012 10:06 AM
  • Hi Sarath,

    Please include enough information in your initial post for people to give a complete answer.

    Once you get the buffer from the string with String::Data() you have a standard C wide-string (wchar_t*) and can use the same C or C++ functions you would normally use for parsing, such as swscanf_s.

    --Rob

    Tuesday, November 27, 2012 10:14 AM
    Owner