package main
import (
"fmt"
"strings"
)
func main() {
str := "192.168.10.5:33069"
fmt.Printf("%s", str[0:strings.Index(str, ":")])
}
Friday, April 22, 2016
How to return part of a string up to specified character
How to return part of a string up to specified character
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment