Home >Backend Development >C#.Net Tutorial >ASP.NET simple format conversion method
1.int str_a=”33”
int i_a=Convert.ToInt16(str_a);Convert to short integer (16)
2.charchar_a ;
char_a=Convert.ToChar(65);
Response.Write(char_a); Convert 65 of the SCII code table into characters;
The result is A
1. char_a; char_a=”hello world”.ToCharArray();Convert string to character typearray
2. Automatic type conversion; int age=10; Response.Write("I am this year"+age+"year"); integer or other types, added together with string type, automatically converted to string type; or another way of writing: Response.Write ("This year I"+age.tostring()+"years old");
3. numb_fen=double.parse(textbox_1.text);
lable_1.text=numb_fen;
lable.forcecolor=system.drawing.color.green;The label foreground color is green;
Convert the text in the text box to double type;
The above is the detailed content of ASP.NET simple format conversion method. For more information, please follow other related articles on the PHP Chinese website!