This commit is contained in:
白茶清欢 2023-01-13 17:59:43 +08:00
parent 8f8476eed0
commit b4b3e261e0

View File

@ -158,21 +158,16 @@ func (s *stringOperate) Map2Query(data map[string]string) string {
return strings.Join(list, "&")
}
// ClearSpace 清理空格
// ClearChar 清理指定字符
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 16:53 2023/1/13
func (s *stringOperate) ClearSpace(src string, spaceList ...string) string {
if len(spaceList) == 0 {
spaceList = []string{
" ",
"\r",
"\n",
"\t",
func (s *stringOperate) ClearChar(src string, charList ...string) string {
if len(charList) == 0 {
return src
}
}
for _, item := range spaceList {
for _, item := range charList {
src = strings.ReplaceAll(src, item, "")
}
return src