...

Source file src/github.com/ory/x/stringsx/split.go

Documentation: github.com/ory/x/stringsx

     1  package stringsx
     2  
     3  import "strings"
     4  
     5  // Splitx is a special case of strings.Split
     6  // which returns an empty slice if the string is empty
     7  func Splitx(s, sep string) []string {
     8  	if s == "" {
     9  		return []string{}
    10  	}
    11  
    12  	return strings.Split(s, sep)
    13  }
    14  

View as plain text