Skip to content

Commit

Permalink
Merge pull request #357 from SepehrBazyar/patch-1
Browse files Browse the repository at this point in the history
Fix Wrong Example Code strings.Join
  • Loading branch information
Ja7ad authored Apr 29, 2024
2 parents a1a26a8 + 7cb9406 commit ba01e43
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions content/chapter 1/1.15-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,11 @@ import (
)

func main() {
text := "Go will make you love programming again. We promise"

textSlice := strings.Split(text, " ")
for _, item := range textSlice {
fmt.Println(item)
}
// array of strings
textSlice := []string{"Go", "will", "make", "you", "love", "programming", "again.", "We", "promise"}

// joining the string by separator
fmt.Println(strings.Join(textSlice, " "))
}
```

Expand Down

0 comments on commit ba01e43

Please sign in to comment.