From the course: Learning the Go Standard Library
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Parsing strings with strconv - Go Tutorial
From the course: Learning the Go Standard Library
Parsing strings with strconv
- [Instructor] All right, the strconv package makes it easy to convert strings to and from basic Go data types such as, integers and floating point numbers. So here in the documentation, for the strconv package at this link, you can see that there's quite a few functions if I scroll down. There's quite a few functions in this package but we're going to concentrate on the ones that perform conversions. So, if you want to explore this package further, I suggest taking some time at the end of this video to try out some of your own experiments. So let's go open up our sample code in the editor. All right, so here in the parse folder, let's open up strparse_start, and I'm going to uncomment my imports for the fmt and strconv packages, and you can see in the main function, I have a couple of sample variables defined, which we'll make use of in a moment. So first, let's illustrate a common mistake that some Go programmers make…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.