00001 #ifndef DEF_STRINGUTIL_H
00002 #define DEF_STRINGUTIL_H
00003
00010 extern char* subString (char *str, int start, int end);
00014 #define stringIn(needle, haystack) strstr(haystack, needle)
00015 extern char *rStringIn(char *needle, char *haystack);
00016 extern char *stringBetween(char *start, char *end, char *haystack);
00017 extern void toggleCase(char *s, int size);
00018 extern void stripChar(char *s, char c);
00019 extern int countChars(char *s, char c);
00020 extern int countSame(char *a, char *b);
00021 extern char *skipLeadingSpaces(char *s);
00022 extern char *skipToSpaces(char *s);
00023 extern void eraseTrailingSpaces(char *s);
00024 extern void eraseWhiteSpace(char *s);
00025 extern char *trimSpaces(char *s);
00026 extern int hasWhiteSpace(char *s);
00027 extern char *firstWordInLine(char *line);
00028 extern char *lastWordInLine(char *line);
00029 extern char *addSuffix(char *head, char *suffix);
00030 extern void chopSuffix(char *s);
00031 extern void chopSuffixAt(char *s, char c);
00032 extern char *chopPrefix(char *s);
00033 extern char *chopPrefixAt(char *s, char c);
00034 extern char *naForNull(char *s);
00035 extern char *naForEmpty(char *s);
00036 extern char *emptyForNull(char *s);
00037 extern char *nullIfAllSpace(char *s);
00038 extern char *trueFalseString(int b);
00039 extern char *skipNumeric(char *s);
00040 extern char *skipToNumeric(char *s);
00041 extern char *insertWordEveryNthPosition (char *string, char *word, int n);
00042
00043 #endif