Let\'s say for example that I have one string, like this:
Hello World!
What Go code would be able to extract Hel
There are lots of ways to split strings in all programming languages.
Since I don't know what you are especially asking for I provide a sample way to get the output you want from your sample.
package main
import "strings"
import "fmt"
func main() {
initial := "Hello World!
"
out := strings.TrimLeft(strings.TrimRight(initial,""),"")
fmt.Println(out)
}
In the above code you trim from the left of the string and from the right.
As I said there are hundreds of ways to split specific strings and this is only a sample to get you started.
Hope it helps, Good luck with Golang :)
DB