From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Convert and format numbers to string

Convert and format numbers to string - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Convert and format numbers to string

- [Instructor] Strings are an important type for most applications. String conversion looks different from the numeric-to-numeric conversions. When converting from a number to a string, use the ToString method. All data types, including the numeric types have the ToString method. When converting from a string to a number, use the Parse or TryParse methods. All numeric data types have these methods. We'll look at Parse in the next video. Here's a quick review of converting between numeric types. Check out line 85. We can use the .NET Convert class to explicitly convert from an integer to a double. The syntax is similar on line 86 where we convert from a double to an integer. For number to number, you can find all the conversion tools in the Convert class. Now let's look at how to convert a number type to a string. The top three examples, string one, two and three are using implicit conversion to a string. It's a…

Contents