How to remove white space from inside of input number:
1 987 to 1987 - I need input number to be int for the rest of script:
int n = Convert.ToInt32(args.Content);
if (n >= 1000)
n = (int) (n - (n * 0.75));
How to remove white space from inside of input number:
1 987 to 1987 - I need input number to be int for the rest of script:
int n = Convert.ToInt32(args.Content);
if (n >= 1000)
n = (int) (n - (n * 0.75));
Use Replace(...):
int n = Convert.ToInt32(args.Content.Replace(" ",""));
if (n >= 1000)
n = (int) (n - (n * 0.75));
string numberWithoutSpaces = new Regex(@"\s").Replace("12 34 56", "");
int n = Convert.ToInt32(numberWithoutSpaces);
try this:
int n = Convert.ToInt32(args.Content.Replace(" ", string.Empty);
This is another solution.
string str = new string(args.Where(c => c != ' ').ToArray());
int n = Convert.ToInt32(str);