Introduction
The strings
package in Golang provides many useful string-related functions. This challenge aims to test your understanding of some of these functions.
The strings
package in Golang provides many useful string-related functions. This challenge aims to test your understanding of some of these functions.
Complete the code below to print the output of various string functions provided by the strings
package.
strings
package to complete the challenge.fmt.Println
function to print the output.$ go run string-functions.go
Contains: true
Count: 2
HasPrefix: true
HasSuffix: true
Index: 1
Join: a-b
Repeat: aaaaa
Replace: f00
Replace: f0o
Split: [a b c d e]
ToLower: test
ToUpper: TEST
This challenge tests your understanding of the strings
package in Golang. You should be able to use the various functions provided by the package to manipulate strings.