func StringReplaceBySlice(subject string, search, replace []string) string {
	if len(search) != len(replace) {
		log.Printf("Unable to replace in string by slice, length of search and replace slices are not equals!"+
			" string: %s, search: %v, replace: %v  ", subject, search, replace)

		return subject
	}

	replaceData := make([]string, 0)
	for key, srch := range search {
		replaceData = append(replaceData, srch)
		replaceData = append(replaceData, replace[key])
	}

	replacer := strings.NewReplacer(replaceData...)
	subject = replacer.Replace(subject)

	return subject
}
//replace substrings in string by search=>replace slices
replace substrings in string by search=>replace slices
// replace substrings in string by search = > replace slices
func StringReplaceBySlice(subject string, search, replace []string) string {
	if len(search) != len(replace) {
		log.Printf("Unable to replace in string by slice, length of search and replace slices are not equals!"+
			" string: %s, search: %v, replace: %v  ", subject, search, replace)
		return subject
	}
	replaceData := make([]string, 0)
	for key, srch := range search {
		replaceData = append(replaceData, srch)
		replaceData = append(replaceData, replace[key])
	}
	replacer := strings.NewReplacer(replaceData...)
	subject = replacer.Replace(subject)
	return subject
}
func StringReplaceBySlice ( subject string , search , replace [ ] string ) string { if len ( search ) != len ( replace ) { log . Printf ( " " + " " , subject , search , replace ) return subject } replaceData := make ( [ ] string , 0 ) for key , srch := range search { replaceData = append ( replaceData , srch ) replaceData = append ( replaceData , replace [ key ] ) } replacer := strings . NewReplacer ( replaceData ... ) subject = replacer . Replace ( subject ) return subject }
replace substrings in string by search=>replace slices
replace substrings in string by search = > replace slices