How to repeat a substring N times into existing string in Go

1 Answer

0 votes
package main
 
import (
    "fmt"
    "strings"
)
 
func main() {
    s := "programmming:"
    s = s + strings.Repeat("go ", 3)

    fmt.Println(s)
}
 
 
 
/*
run:
  
programmming:go go go 
  
*/

 



answered Aug 20, 2020 by avibootz

Related questions

1 answer 183 views
1 answer 94 views
94 views asked Dec 23, 2024 by avibootz
1 answer 181 views
1 answer 217 views
1 answer 199 views
1 answer 100 views
1 answer 80 views
...