repeat_string.go 198 B

1234567891011121314
  1. package main
  2. import (
  3. "fmt"
  4. "strings"
  5. )
  6. func main() {
  7. var origS string = "Hi there! "
  8. var newS string
  9. newS = strings.Repeat(origS, 3)
  10. fmt.Printf("The new repeated string is: %s\n", newS)
  11. }