3
Answers

Convert from a string of expression into a float result in C#

Photo of Minh

Minh

14y
5.6k
1
Hi friends ,
I have a string like : "10*2"
now, i want to return the result as a float for that string expression : 20 = (10*2)
how can i do it , thanks .

Answers (3)

1
Photo of Frogleg
NA 7.9k 33k 12y
Here
drag a timer onto form and set interval to 1
 public partial class Form1 : Form
  {
  int milli = 0;
  public Form1()
  {
  InitializeComponent();
  }

  private void button1_Click(object sender, EventArgs e)
  {
  timer1.Start();
  }

  private void timer1_Tick(object sender, EventArgs e)
  {
  milli++;
  label1.Text = milli.ToString();
  }
  }
0
Photo of Jane Abrams
NA 3 2.3k 12y
The result is not in milliseconds