Skip to content

Commit

Permalink
feat: create SanitizeString function
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanCapistrano committed Sep 17, 2023
1 parent 2d34940 commit 6e09b44
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/sanitize.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package utils

import "regexp"

// Sanitizes all '\u' in a string.
func SanitizeString(input string) string {
re := regexp.MustCompile(`\\u[0-9a-fA-F]+`)

sanitized := re.ReplaceAllString(input, "")

return sanitized
}

0 comments on commit 6e09b44

Please sign in to comment.