mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-06 21:52:28 +08:00
feat: add SubInBetween
This commit is contained in:
@@ -653,3 +653,17 @@ func ExampleRemoveWhiteSpace() {
|
||||
// helloworld
|
||||
// hello world
|
||||
}
|
||||
|
||||
func ExampleSubInBetween() {
|
||||
str := "abcde"
|
||||
|
||||
result1 := SubInBetween(str, "", "de")
|
||||
result2 := SubInBetween(str, "a", "d")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
|
||||
// Output:
|
||||
// abc
|
||||
// bc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user