Skip to content

Instantly share code, notes, and snippets.

@xvbnm48
Created March 10, 2024 06:24
Show Gist options
  • Save xvbnm48/bc2ad4b0de3074f91af4e3723287009d to your computer and use it in GitHub Desktop.
Save xvbnm48/bc2ad4b0de3074f91af4e3723287009d to your computer and use it in GitHub Desktop.
string go
package main
import "fmt"
func main() {
// deklarasi variabel
var idol = "hira dazzle"
var nama = `Vini`
var nama2 = `vini adalah idol dari hira dazzle,
dengan julukan emerald green`
fmt.Println(idol)
fmt.Println(nama)
fmt.Println(nama2)
// unicode
fmt.Println("\u65E5\u672C")
// concatenation
fmt.Println(nama,"idol dari", idol)
// Substring
nama4 := "Vini"
// print substring from nama
fmt.Println("hasil dari substring dari start index 1 dan end index 3 adalah ", string(nama4[1:3]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment