I am currently struggling to write on how to concatenate same letter values onto a string array. In other languages such as Java & C, I can simply use some libraries/functions. But in Go, I am totally lost.
For example,
isSame(“bbcomqdd”);
I want the input to be [bb c o m q dd], not like the following below [bb dd]
A simple code for looking for same letters and append it, then put onto an array string.
Sorry, I do not really understand what you mean, and all the random asterisks make it hard to copy and run the code.
Could you therefore please either use markdown to fromat your code or provide a link to the playground that has some executable code that shows us what your problem is?
package main
import (
"fmt"
)
func main() {
str := "oopdwmeoo"
prv := []rune(str)[0]
for _, c := range str {
fmt.Printf("%c", c)
if prv != c {
fmt.Printf(" ")
prv = c
}
}
}
If you don’t mind me asking, how do I possibly make a contact with you besides here? It seems that you’re profoundly proficient in Golang. I would be feeling much appreciated.