{"id":2039,"date":"2020-04-17T18:19:20","date_gmt":"2020-04-17T18:19:20","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=2039"},"modified":"2020-04-17T18:19:31","modified_gmt":"2020-04-17T18:19:31","slug":"get-ascii-value-alphabet-go","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/","title":{"rendered":"Get ASCII code\/value of any Alphabet or Number in Go (Golang)"},"content":{"rendered":"\n

range<\/strong> over a string can give the ASCII<\/strong> of all the characters in the string. In below code we are printing the ASCII value of a lowercase alphabets, uppercase alphabets and numbers.<\/p>\n\n\n\n

package main\n\nimport \"fmt\"\n\nfunc main() {\n    lowercase := \"abcdefghijklmnopqrstunwxyz\"\n    for _, c := range lowercase {\n        fmt.Println(c)\n    }\n\n    uppercase := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    for _, c := range uppercase {\n        fmt.Println(c)\n    }\n\n    numbers := \"0123456789\"\n    for _, n := range numbers {\n        fmt.Println(n)\n    }\n}<\/code><\/pre>\n\n\n\n

Output:<\/strong><\/p>\n\n\n\n

97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n110\n119\n120\n121\n122\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

range over a string can give the ASCII of all the characters in the string. In below code we are printing the ASCII value of a lowercase alphabets, uppercase alphabets and numbers….<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[283,281,267,3,4,284,218,285,282],"class_list":["post-2039","post","type-post","status-publish","format-standard","hentry","category-tech","tag-alphabet","tag-ascii","tag-code","tag-go","tag-golang","tag-lowercase","tag-number","tag-uppercase","tag-value"],"yoast_head":"\nGet ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example\" \/>\n<meta property=\"og:description\" content=\"range over a string can give the ASCII of all the characters in the string. In below code we are printing the ASCII value of a lowercase alphabets, uppercase alphabets and numbers....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/\" \/>\n<meta property=\"og:site_name\" content=\"Welcome To Golang By Example\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-17T18:19:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-17T18:19:31+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/\",\"url\":\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/\",\"name\":\"Get ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example\",\"isPartOf\":{\"@id\":\"https:\/\/golangbyexamples.com\/#website\"},\"datePublished\":\"2020-04-17T18:19:20+00:00\",\"dateModified\":\"2020-04-17T18:19:31+00:00\",\"author\":{\"@id\":\"https:\/\/golangbyexamples.com\/#\/schema\/person\/8833ea7638dafd763cb1db6c0ca4576f\"},\"breadcrumb\":{\"@id\":\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/golangbyexamples.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get ASCII code\/value of any Alphabet or Number in Go (Golang)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/golangbyexamples.com\/#website\",\"url\":\"https:\/\/golangbyexamples.com\/\",\"name\":\"Welcome To Golang By Example\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/golangbyexamples.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/golangbyexamples.com\/#\/schema\/person\/8833ea7638dafd763cb1db6c0ca4576f\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/golangbyexamples.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/golangbyexamples.com\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/","og_locale":"en_US","og_type":"article","og_title":"Get ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example","og_description":"range over a string can give the ASCII of all the characters in the string. In below code we are printing the ASCII value of a lowercase alphabets, uppercase alphabets and numbers....","og_url":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/","og_site_name":"Welcome To Golang By Example","article_published_time":"2020-04-17T18:19:20+00:00","article_modified_time":"2020-04-17T18:19:31+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/","url":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/","name":"Get ASCII code\/value of any Alphabet or Number in Go (Golang) - Welcome To Golang By Example","isPartOf":{"@id":"https:\/\/golangbyexamples.com\/#website"},"datePublished":"2020-04-17T18:19:20+00:00","dateModified":"2020-04-17T18:19:31+00:00","author":{"@id":"https:\/\/golangbyexamples.com\/#\/schema\/person\/8833ea7638dafd763cb1db6c0ca4576f"},"breadcrumb":{"@id":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/golangbyexamples.com\/get-ascii-value-alphabet-go\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/golangbyexamples.com\/"},{"@type":"ListItem","position":2,"name":"Get ASCII code\/value of any Alphabet or Number in Go (Golang)"}]},{"@type":"WebSite","@id":"https:\/\/golangbyexamples.com\/#website","url":"https:\/\/golangbyexamples.com\/","name":"Welcome To Golang By Example","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/golangbyexamples.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/golangbyexamples.com\/#\/schema\/person\/8833ea7638dafd763cb1db6c0ca4576f","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/golangbyexamples.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/golangbyexamples.com\/author\/admin\/"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paOs1b-wT","amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/posts\/2039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/comments?post=2039"}],"version-history":[{"count":2,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/posts\/2039\/revisions"}],"predecessor-version":[{"id":2041,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/posts\/2039\/revisions\/2041"}],"wp:attachment":[{"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/media?parent=2039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/categories?post=2039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/golangbyexamples.com\/wp-json\/wp\/v2\/tags?post=2039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}