Help me please..
-
How can I enter in a textbox(for example textbox1) a list of coefficients and convert this list of coefficients from input string to an array of doubles so I can use it to obtain numerator and denominator of a function? Help me please cause I am a beginner.Best regards
-
How can I enter in a textbox(for example textbox1) a list of coefficients and convert this list of coefficients from input string to an array of doubles so I can use it to obtain numerator and denominator of a function? Help me please cause I am a beginner.Best regards
I don't know how you separate each number, but let's assume it's comma separated values, like 1,3,9,75. The first thing you have to do is separate this values, you can use the Split method of the string class. char[] separator = new char[1]; separator[0] = ','; string[] numbers = textbox1.Text.Split(separator); double[] coeficients = new double[numbers.Lenght]; for (int i = 0; i < numbers.Lenght; i++) { try { coeficients[i] = double.Parse(numbers[i]); } catch { } }