I'm trying to run this piece of code to replace a character of a string by a random number:
//Get the position between 0 and the length of the string-1 to insert a random number
position := rand.Intn(count - 1)
strings.Replace(RandomString,)
fmt.Println("Going to change the position number: ", position)
//Insert a random number between [0-9] in the position
RandomString = RandomString[:position] + string(rand.Intn(9)) + RandomString[position+1:]
When this is executed, the output is:
I was going to generate.. ljFsrPaUvmxZFFw
Going to change the position number: 2
Random string: lsrPaUvmxZFFw
Could anyone help me about inserting that number inside the desired string position? I didn't find any duplicate case of this.
Thanks in advance.