package util

import (
	"strconv"
	"strings"
)

// Int32SliceToString 将int32的切片转换成字符串,元素之间用sep分隔
func Int32SliceToString(slice []int32, sep string) string {
	var builder strings.Builder

	for i, v := range slice {
		if i > 0 {
			builder.WriteString(sep)
		}
		// 使用strconv.FormatInt将int32转换为字符串
		builder.WriteString(strconv.FormatInt(int64(v), 10))
	}

	return builder.String()
}