Posted on 12th May 2025|7333 views
How to convert the byte to int in golang?
Posted on 12th May 2025| views
Here is an example:
package main
import (
"fmt"
)
func main() {
aByte := byte(148)
asInt := int(aByte)
fmt.Println(asInt)
aString := "x"
asInt2 := int(aString[0])
fmt.Println(asInt2)
newString := string(aString[0] + 1)
fmt.Println(newString)
}