Strings In Depth13 / 17
Up next

strconv converts numbers

package main

import (
	"fmt"
	"strconv"
)

func main() {
	n, _ := strconv.Atoi("42")
	fmt.Println(n + 1)
	// turn a number back into text
	s := strconv.Itoa(100)
	fmt.Println(s + "!")
}
What you're solving

Atoi parses, Itoa formats