update
This commit is contained in:
parent
8f8476eed0
commit
b4b3e261e0
15
string.go
15
string.go
@ -158,21 +158,16 @@ func (s *stringOperate) Map2Query(data map[string]string) string {
|
|||||||
return strings.Join(list, "&")
|
return strings.Join(list, "&")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearSpace 清理空格
|
// ClearChar 清理指定字符
|
||||||
//
|
//
|
||||||
// Author : go_developer@163.com<白茶清欢>
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
//
|
//
|
||||||
// Date : 16:53 2023/1/13
|
// Date : 16:53 2023/1/13
|
||||||
func (s *stringOperate) ClearSpace(src string, spaceList ...string) string {
|
func (s *stringOperate) ClearChar(src string, charList ...string) string {
|
||||||
if len(spaceList) == 0 {
|
if len(charList) == 0 {
|
||||||
spaceList = []string{
|
return src
|
||||||
" ",
|
|
||||||
"\r",
|
|
||||||
"\n",
|
|
||||||
"\t",
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for _, item := range spaceList {
|
for _, item := range charList {
|
||||||
src = strings.ReplaceAll(src, item, "")
|
src = strings.ReplaceAll(src, item, "")
|
||||||
}
|
}
|
||||||
return src
|
return src
|
||||||
|
Loading…
Reference in New Issue
Block a user