Mercurial > repos > aaronquinlan > multi_intersect
annotate BEDTools-Version-2.14.3/src/utils/stringUtilities/stringUtilities.h @ 0:dfcd8b6c1bda
Uploaded
| author | aaronquinlan |
|---|---|
| date | Thu, 03 Nov 2011 10:25:04 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
| 0 | 1 #ifndef STRINGUTILITIES_H |
| 2 #define STRINGUTILITIES_H | |
| 3 | |
| 4 #include <cctype> | |
| 5 #include <string> | |
| 6 | |
| 7 /**************************************************** | |
| 8 // isInteger(s): Tests if string s is a valid integer | |
| 9 *****************************************************/ | |
| 10 inline bool isInteger(const std::string& s) { | |
| 11 int len = s.length(); | |
| 12 for (int i = 0; i < len; i++) { | |
| 13 if (!std::isdigit(s[i])) return false; | |
| 14 return true; | |
| 15 } | |
| 16 | |
| 17 #endif /* STRINGUTILITIES_H */ | |
| 18 |
