---
title: "Discussion on \"Go cheatsheet - String to Number\" | Hashnode"
description: "Discussion on \"Go cheatsheet - String to Number\". String to Number\nAtoi\nk, _ := strconv.Atoi(\"135\")\n// k = 135\n\nn, e := strconv.Atoi(\"wat\")\n// n = 0, e is not nil\n\nParseInt\ni, _ := strconv.ParseInt(\"123\", 10, 64)\n// i = 123\nd1, _ := strconv.ParseInt(\"0x1c8\", 0, 64)\n// d1 = 456\nd2, _ := strconv.Parse..."
url: "https://hashnode.com/posts/go-cheatsheet-string-to-number/607f9a0deb2bd30d2d22c392"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Go cheatsheet - String to Number](https://hn.0xbf.me/go-cheatsheet-string-to-number?utm_source=hashnode&utm_medium=feed)

String to Number Atoi k, \_ := strconv.Atoi("135") // k = 135 n, e := strconv.Atoi("wat") // n = 0, e is not nil ParseInt i, \_ := strconv.ParseInt("123", 10, 64) // i = 123 d1, \_ := strconv.ParseInt("0x1c8", 0, 64) // d1 = 456 d2, \_ := strconv.Parse...

Apr 21, 2021 · 1 min read · hn.0xbf.me  
Read the article

-   [#go](https://hashnode.com/tag/go)

## Written by

[0xBF](https://hashnode.com/@0xbf)

@0xbf

  
[View profile](https://hashnode.com/@0xbf)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
