Go Package strconv

From NovaOrdis Knowledge Base
Revision as of 04:41, 22 August 2023 by Ovidiu (talk | contribs) (→‎Itoa())
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Internal

Overview

The strconv package contains functions to convert strings to and from other data types.

Functions

Atoi()

https://pkg.go.dev/strconv#Atoi

ASCII-to-int, converts a string representation of an integer to an int type.

import "strconv"

a := "15"
b, error := strconv.Atoi(a)
println(b, error)

Itoa()

https://pkg.go.dev/strconv#Itoa

Converts an integer to its string representation.

FormatFloat()

https://pkg.go.dev/strconv#FormatFloat

ParseFloat()

https://pkg.go.dev/strconv#ParseFloat