Home > Net >  Industrial common three casts
Industrial common three casts

Time:11-25

Here enumerated types are: string - & gt; Int. String - & gt; Double; Double - & gt; String code below
 string int_string="123456"; 
String double_string="3.1415926";
Double Double_number=3.1415926;


Int number1.
Double number2.
String number3.

Number1=the Convert. ToInt32 (int_string);
Number2.=the Convert ToDouble (double_string);
Number3=Double_number. ToString ();

Console. WriteLine (" number1: {0} number2: {1} number3: {2} ", number1, number2, number3);
Console.ReadKey();

CodePudding user response:

Int. J parse
Int. J tryparse
  •  Tags:  
  • C#
  • Related