How to find the last index of substring in a string with Go

1 Answer

0 votes
package main 
  
import ( 
    "fmt"
    "strings"
) 
  
func main() { 
    s := "go java c++ php go python"
  
    r := strings.LastIndex(s, "go") 
  
    fmt.Println(r) 
}  
   
   
     
/*
run:
     
16
     
*/

 



answered Aug 3, 2020 by avibootz

Related questions

2 answers 216 views
1 answer 171 views
1 answer 199 views
2 answers 205 views
...