replace zxq.co/ripple/hanayo
This commit is contained in:
16
vendor/zxq.co/ripple/rippleapi/common/sanitisation.go
vendored
Normal file
16
vendor/zxq.co/ripple/rippleapi/common/sanitisation.go
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// SanitiseString removes all control codes from a string.
|
||||
func SanitiseString(s string) string {
|
||||
n := make([]rune, 0, len(s))
|
||||
for _, c := range s {
|
||||
if c == '\n' || !unicode.Is(unicode.Other, c) {
|
||||
n = append(n, c)
|
||||
}
|
||||
}
|
||||
return string(n)
|
||||
}
|
Reference in New Issue
Block a user