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 - Visual Basic Tutorial
From the course: Visual Basic Essential Training
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
-
-
-
-
-
-
-
-
-
Work with variables and constants4m 56s
-
(Locked)
Use the Code Explorer project1m 59s
-
(Locked)
Declare a variable6m 30s
-
(Locked)
Tips to make literals pop in the editor2m 34s
-
(Locked)
Work with custom and built-in constants3m 54s
-
(Locked)
Understand variable scope5m 42s
-
(Locked)
Understand numeric to numeric conversions5m 54s
-
(Locked)
Convert numeric values5m 43s
-
(Locked)
Convert and format numbers to string6m 39s
-
(Locked)
Convert and parse string to numbers5m 59s
-
(Locked)
Work with strings7m 11s
-
(Locked)
Work with dates and times9m 21s
-
(Locked)
Challenge: Strings, dates, and parsing52s
-
(Locked)
Solution: Strings, dates, and parsing2m 5s
-
-
-
-
-
-
-
-