MCPcopy Create free account
hub / github.com/araddon/qlbridge / IdentityTrim

Function IdentityTrim

expr/stringutil.go:61–73  ·  view source on GitHub ↗

IdentityTrim trims the leading/trailing identity quote marks ` or []

(ident string)

Source from the content-addressed store, hash-verified

59
60// IdentityTrim trims the leading/trailing identity quote marks ` or []
61func IdentityTrim(ident string) string {
62 if len(ident) > 0 {
63 if ident[0] == '`' || ident[0] == '[' {
64 ident = ident[1:]
65 }
66 if len(ident) > 0 {
67 if ident[len(ident)-1] == '`' || ident[len(ident)-1] == ']' {
68 ident = ident[0 : len(ident)-1]
69 }
70 }
71 }
72 return ident
73}
74
75// IdentityMaybeQuote
76func IdentityMaybeQuote(quote byte, ident string) string {

Callers 2

tableFromSQLFunction · 0.92
LeftRightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected