statement_quote.go 352 B

12345678910111213141516171819
  1. // Copyright 2019 The Xorm Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package xorm
  5. func trimQuote(s string) string {
  6. if len(s) == 0 {
  7. return s
  8. }
  9. if s[0] == '`' {
  10. s = s[1:]
  11. }
  12. if len(s) > 0 && s[len(s)-1] == '`' {
  13. return s[:len(s)-1]
  14. }
  15. return s
  16. }