Type conversion Convert.ToInt32 (pending string);

Source: Internet
Author: User

Convert is no longer just a memory-level conversion, but a conversion that considers the meaning of the data. is a process of processing transformation.

Grammar:

int (variable name) =convert.toint32 (the string to be converted);//Convert the string to be converted to an int type and assign to the variable.

Cases:

Console.WriteLine ("Please input your language score");

int Chinesescore=convert.toint32 (Console.ReadLine ());

Console.WriteLine ("Please enter your math score");

int Mathscore=convert.toint32 (Console.ReadLine ());

Console.WriteLine ("Your total is: {0}", Chinesescore+mathscore);

Console.readkey ();

Type conversion Convert.ToInt32 (pending string);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.