Introduction
The purpose of this challenge is to demonstrate how to parse numbers from strings in Go.
The purpose of this challenge is to demonstrate how to parse numbers from strings in Go.
Parsing numbers from strings is a common task in many programs. This challenge requires you to use the built-in strconv
package to parse different types of numbers from strings.
strconv
package to parse numbers from strings.ParseFloat
.ParseInt
.ParseInt
.ParseUint
.Atoi
.$ go run number-parsing.go
1.234
123
456
789
135
strconv.ParseInt: parsing "wat": invalid syntax
## Next we'll look at another common parsing task: URLs.
This challenge demonstrated how to parse different types of numbers from strings in Go using the strconv
package. By completing this challenge, you should have a better understanding of how to handle number parsing in your Go programs.