Csharp/CSharp Tutorial/Data Type/float parse — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:18, 26 мая 2010
Parsing: int, float, bool
<source lang="csharp">using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Security.Cryptography; public class MainClass {
public static void Main() { int i = int.Parse("550"); float f = float.Parse("21.99328"); bool b = bool.Parse("True"); }
}</source>
Using float.Parse() to Convert a string to a Numeric Data Type
<source lang="csharp">class MainClass {
static void Main() { string text = "9.11E-31"; float kgElectronMass = float.Parse(text); }
}</source>