O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Type Conversion

Programs often need to convert values from one type to another. For example, if the user types the value 10 into a text box, the program might want to convert that string value into the number 10. Although the string value 10 is obviously a number to a human, the difference between the string 10 and the number 10 is critical to a computer program. The program cannot perform arithmetic operations, such as addition and multiplication, on the value unless it has a numeric type.

Similarly, a program cannot treat a numeric value as if it were a string. For example, it could not extract the last character in the number 1337 because 1337 is not a string. The program would first need to convert the value from a number into a string before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required