Skip to content
Snippets Groups Projects
Commit 6169696c authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Added TrimSpaceForPointer to string utils

parent 8069cd0a
Branches
Tags v1.151.0
No related merge requests found
......@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/number_utils"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/utils"
"regexp"
"strconv"
"strings"
......@@ -259,3 +260,10 @@ func PrettyJSON(jsonString string) (validJson bool, prettyString string) {
}
return
}
func TrimSpaceForPointer(s *string) *string {
if utils.PointerToValue(s) != "" {
return utils.ValueToPointer(strings.TrimSpace(*s))
}
return s
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment