src/inc/common.h 1.170

1.170 2010/04/15 19:25:12 tdreszer
Added stripEnclosingQuotes()
Index: src/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.169
retrieving revision 1.170
diff -b -B -U 4 -r1.169 -r1.170
--- src/inc/common.h	1 Apr 2010 17:31:10 -0000	1.169
+++ src/inc/common.h	15 Apr 2010 19:25:12 -0000	1.170
@@ -776,8 +776,14 @@
 
 void stripChar(char *s, char c);
 /* Remove all occurences of c from s. */
 
+char *stripEnclosingChar(char *inout,char encloser);
+// Removes enclosing char if found at both beg and end, preserving pointer
+// Note: handles brackets '(','{' and '[' by complement at end
+#define stripEnclosingDoubleQuotes(inout) stripEnclosingChar((inout),'"')
+#define stripEnclosingSingleQuotes(inout) stripEnclosingChar((inout),'\'')
+
 void stripString(char *s, char *strip);
 /* Remove all occurences of strip from s. */
 
 int countChars(char *s, char c);