Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static String[] extractNumbers(String arg)
- {
- String[] temp = new String[arg.Length];
- int j = 0;
- for (int i = 0; i < arg.Length; i++)
- {
- if (arg[i] >= '0' && arg[i] <= '9')
- {
- int begin = i, count = 0;
- while (arg[i] >= '0' && arg[i] <= '9')
- {
- count++;
- i++;
- }
- if(count > 0)
- {
- temp[j] = arg.Substring(begin, count);
- j++;
- }
- }
- }
- String[] result = new String[j];
- Array.Copy(temp, result, j);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement