mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
backport sql parser improved from fastsql
This commit is contained in:
@@ -386,4 +386,18 @@ public class StringUtils {
|
||||
chars[18] = (char) (second%10 + '0');
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public static String removeNameQuotes(String s) {
|
||||
if (s == null || s.length() <= 1) {
|
||||
return null;
|
||||
}
|
||||
int len = s.length();
|
||||
char c0 = s.charAt(0);
|
||||
char last = s.charAt(len - 1);
|
||||
|
||||
if (c0 == last && (c0 == '`' || c0 == '\'' || c0 == '\"') ) {
|
||||
return s.substring(1, len - 1);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user