view 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
line wrap: on
line source

#ifndef STRINGUTILITIES_H
#define STRINGUTILITIES_H

#include <cctype>
#include <string>

/****************************************************
// isInteger(s): Tests if string s is a valid integer
*****************************************************/
inline bool isInteger(const std::string& s) {
    int len = s.length();
    for (int i = 0; i < len; i++) {
        if (!std::isdigit(s[i])) return false;
    return true;
}

#endif /* STRINGUTILITIES_H */