My string looks like this,
"<tlc:919876543212@abc.google.com>; tag=kkytuybsjdf <nil>"
I want to fetch the value-> 919876543212 from the string ,how to slice the string starting from next to the ':' and before the '@'
My string looks like this,
"<tlc:919876543212@abc.google.com>; tag=kkytuybsjdf <nil>"
I want to fetch the value-> 919876543212 from the string ,how to slice the string starting from next to the ':' and before the '@'
OP's answer, which was incorrectly edited into the question:
Solution:
a := "<tlc:919876543212@abc.google.com>; tag=kkytuybsjdf <nil>"
n := strings.Index(a, ":")
m := strings.Index(a, "@")
if n > -1 && m > -1 {
number := a[n+1 : m]
fmt.Println(number)
} else {
fmt.Println("Index not found")
}