I have for example a line:
inputData = "-80 * 5-5"
There is the following code that splits positive numbers:
private static readonly char[] validOperators = { '/', '*', '+', '-' };
var numbersOfExpression = inputData
.Split(validOperators, StringSplitOptions.RemoveEmptyEntries)
.Select(s => double.Parse(s)).ToList();
But it doesn't work with negative numbers.
I am looking for a solution without Regex as it creates additional complexity.