Using float.Parse() to Convert a string to a Numeric Data Type : float parse « Data Type « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {

    string text = "9.11E-31";
    float kgElectronMass = float.Parse(text);

  }
}








2.23.float parse
2.23.1.Parsing: int, float, bool
2.23.2.Using float.Parse() to Convert a string to a Numeric Data Type