mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-07 22:50:53 +08:00
18 lines
353 B
Go
18 lines
353 B
Go
package collection
|
|
|
|
// Returns symbol <count> times, with <separator> between each one.
|
|
// if symbol = ?, separator = , and count = 5
|
|
// this returns: "?,?,?,?,?"
|
|
func RepeatSymbol(count int, symbol, separator string) string {
|
|
result := ""
|
|
for i := 0; i < count; i++ {
|
|
if i != 0 {
|
|
result += separator
|
|
}
|
|
|
|
result += symbol
|
|
}
|
|
|
|
return result
|
|
}
|