package main
import (
"bytes"
"fmt"
)
func main() {
slice_1 := [][]byte{[]byte(
"Geeks"
), []byte(
"for"
), []byte(
"Geeks"
)}
slice_2 := [][]byte{[]byte(
"Hello"
), []byte(
"My"
),
[]byte(
"name"
), []byte(
"is"
), []byte(
"Bongo"
)}
fmt.Println(
"Slice(Before):"
)
fmt.Printf(
"Slice 1: %s "
, slice_1)
fmt.Printf(
"\nSlice 2: %s"
, slice_2)
res1 := bytes.Join(slice_1, []byte(
" , "
))
res2 := bytes.Join(slice_2, []byte(
" * "
))
res3 := bytes.Join([][]byte{[]byte(
"Hey"
), []byte(
"I"
),
[]byte(
"am"
), []byte(
"Apple"
)}, []byte(
"+"
))
fmt.Println(
"\n\nSlice(after):"
)
fmt.Printf(
"New Slice_1: %s "
, res1)
fmt.Printf(
"\nNew Slice_2: %s"
, res2)
fmt.Printf(
"\nNew Slice_3: %s"
, res3)
}