logo-MindMajix
PostGoLangGoLang
christina joce

Posted on 26th July 2024|7333 views

0
votes

Byte To Int Golang

How to convert the byte to int in golang?

1 answers
Answers
P
ravi sankar

Posted on 26th July 2024| 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)

}

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number