I'm working on an assignment for class and I would like some help. I have to create a calculator. In order to do the calculation, when the math operator is entered, there is a space on either side, so that I can split by the white spaces.
Private Sub btnEqual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEqual.Click Dim splitNumbers As String splitNumbers=txtCompute.Text.Split(" ") Dim numberOne, numberTwo, mathOperator As String numberOne= CDbl(splitNumbers(0)) mathOperator=splitNumbers(1) numberTwo=CDbl(splitNumbers(2)) End Sub
This was my original idea of how I could accomplish my goal, however, I get an error message saying that splitNumbers cannot be of type string. Do I have to create an array to do this or is there an easier way than what I'm seeing?
Thank you in advance!!