How can I remove the strings and get only integers?
I have a string ( 01 - ABCDEFG )
i need to get (01) only
How can I delete all data from string (char array) in C lang? The typical way to do this is to set every character of the string to zero. The easiest way to do this is to use memset, assuming you know how much much valid memory the string has.
In C, the atoi() function converts a string to an integer.
input = Regex.Replace(input, "[^0-9]+", string.Empty);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With