Last active
July 12, 2018 15:10
-
-
Save hi-manshu/ed8df9b964ef40bc84d64060584f6532 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| //imported the package fmt | |
| import "fmt" | |
| func main() { | |
| //main function gets called when the program runs | |
| // declared the first variable with datatype string | |
| var firstName string = "Himanshu " | |
| // declared the second variable without any datatype | |
| var secondName = "Singh" | |
| // declared the third variable without any datatype and keyword var to store the new string | |
| fullName := firstName + secondName | |
| // will display the full name in the terminal | |
| fmt.Println(fullName) | |
| } | |
| >>go run stringExample.go | |
| >>Himanshu Singh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment