Go strings Package HasSuffix()

Introduction

To determine if a bigger string ends with a smaller string, use the HasSuffix function:

package main //ww  w.jav  a 2  s.co  m

import ( 
    "fmt" 
    "strings" 
) 

func main() { 
    // func HasSuffix(s, suffix string) bool 
    fmt.Println(strings.HasSuffix("test", "st")) 
    // => true 
} 



PreviousNext

Related