how to convert valied strings into int?
-
i am having string's like following examples in a loop ------------------- @123456 @65465498 @-65465498 123456k 65465498 k -65465498 l how are u nice dear -------------------- these are the strings that i want to convert them into integer value but they also contain characters and speces and sentances. how to convert valied strings into int? can any body tell the good check so that ? is there any way to neglect character in a string? r00d0034@yahoo.com
-
i am having string's like following examples in a loop ------------------- @123456 @65465498 @-65465498 123456k 65465498 k -65465498 l how are u nice dear -------------------- these are the strings that i want to convert them into integer value but they also contain characters and speces and sentances. how to convert valied strings into int? can any body tell the good check so that ? is there any way to neglect character in a string? r00d0034@yahoo.com
Why are you asking this on the C++ forum, having found out how to do it in C# ? Is it a bad enough problem to change languages over ? In C++, you have some functions called ::isalpha and ::isalnum. If the first returns false and the second returns true, you have a number. These functions take a character, not a string. You need to use these functions to parse your strings, then use atoi on the strings that you've verified have only numbers, or built to have only numbers. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
i am having string's like following examples in a loop ------------------- @123456 @65465498 @-65465498 123456k 65465498 k -65465498 l how are u nice dear -------------------- these are the strings that i want to convert them into integer value but they also contain characters and speces and sentances. how to convert valied strings into int? can any body tell the good check so that ? is there any way to neglect character in a string? r00d0034@yahoo.com
-
Why are you asking this on the C++ forum, having found out how to do it in C# ? Is it a bad enough problem to change languages over ? In C++, you have some functions called ::isalpha and ::isalnum. If the first returns false and the second returns true, you have a number. These functions take a character, not a string. You need to use these functions to parse your strings, then use atoi on the strings that you've verified have only numbers, or built to have only numbers. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
thanks a lot for your answer? i hope you have found your answer? r00d0034@yahoo.com
-
thanks a lot for your answer? i hope you have found your answer? r00d0034@yahoo.com
imran_rafique wrote: thanks a lot for your answer? You're welcome. imran_rafique wrote: i hope you have found your answer? Yes, thanks. I asked a couple of questions a day or so ago, got some pointers, looked them up in the MSDN and all is well with me. Good luck with your project. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002