1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add go playground demo

This commit is contained in:
dudaodong
2023-06-20 14:04:18 +08:00
parent 3050d93703
commit 8f49078eb3
12 changed files with 63 additions and 21 deletions

View File

@@ -561,7 +561,7 @@ var (
// RemoveWhiteSpace remove whitespace characters from a string.
// when set repalceAll is true removes all whitespace, false only replaces consecutive whitespace characters with one space.
// Play: todo
// Play: https://go.dev/play/p/HzLC9vsTwkf
func RemoveWhiteSpace(str string, repalceAll bool) string {
if repalceAll && str != "" {
return strings.Join(strings.Fields(str), "")