Created
March 10, 2024 06:24
-
-
Save xvbnm48/bc2ad4b0de3074f91af4e3723287009d to your computer and use it in GitHub Desktop.
string go
This file contains 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 | |
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