From the course: C# and .NET Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Parsing numbers

Parsing numbers

- [Instructor] Working with numbers and dates are very common scenarios in programming and in this chapter, we're going to look at some of the ways that .NET makes this much easier. We're going to start by looking at how to use .NET to parse numbers from strings, and I'm sure you can imagine that there are lots of different scenarios where this kind of conversion needs to be performed, such as when the user enters a string of data into a form or some other type of user input. So here in my VS Code editor, in the ParseNumbers folder, in the Start folder. I'm going to open up my code and here in my code for this exercise, I have an array of strings that represent different number types, right? So I have an integer, some floating points, right? I've got scientific notation number here, and you can see that some of them have white space in the strings, right? So there's some spaces here and so on. So each of the basic data types…

Contents