1
0
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:
dudaodong
2023-06-08 16:47:31 +08:00
parent bfa9091c09
commit 9b829aa695
3 changed files with 44 additions and 0 deletions

View File

@@ -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
}