mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
feat: add RemoveWhiteSpace
This commit is contained in:
@@ -619,3 +619,17 @@ func ExampleContainsAny() {
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleRemoveWhiteSpace() {
|
||||
str := " hello \r\n \t world"
|
||||
|
||||
result1 := RemoveWhiteSpace(str, true)
|
||||
result2 := RemoveWhiteSpace(str, false)
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
|
||||
// Output:
|
||||
// helloworld
|
||||
// hello world
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user