How to get the ASCII value of a character in Go

1 Answer

0 votes
package main

import "fmt"

func main() {
    ch := 'a'
    
    asciiValue := int(ch)
    
    fmt.Println(asciiValue)
}



/*
run:

97

*/

 



answered Jul 4, 2024 by avibootz

Related questions

...