51 for (c = symbols_; *c; c++) {
52 if (!
isalpha (*c))
return false;
63 for (c = symbols_; *c; c++) {
73 for (string::const_iterator c = symbols_.begin (); c != symbols_.end (); c++) {
74 if (!
isspace (*c))
return false;
83 for (c = symbols_; *c; c++) {
84 if (!
islower (*c))
return false;
94 for (c = symbols_; *c; c++) {
95 if (!
isupper (*c))
return false;
114 bool upperEqualsLower_)
116 string symbols (symbols_);
117 if (upperEqualsLower_) {
118 for (string::iterator
i = symbols.begin ();
i != symbols.end ();
i++) {
122 sort <string::iterator> (symbols.begin (), symbols.end ());
123 return unique <string::iterator> (symbols.begin (), symbols.end ()) != symbols.end ();
135 if (
i == symbols_)
return;
137 for (j = symbols_; *
i;
i++, j++)
147 char *
str =
new char [symbols_.size () + 1];
149 strcpy (
str, symbols_.c_str ());
159 reverse (symbols_, symbols_ + strlen (symbols_));
161 reverse (symbols_, symbols_ + strlen (symbols_));
166 char *
str =
new char [symbols_.size () + 1];
168 strcpy (
str, symbols_.c_str ());
181 for (
i = j = symbols_; *
i;
i++) {
182 if (!
isspace(*
i) || (*
i !=
' ' && eraseBlankOnly_)) {
192 char *
str =
new char [symbols_.size () + 1];
194 strcpy (
str, symbols_.c_str ());
207 for (
i = symbols_; *
i;
i++)
211 for (s = c_; *s; s++)
223 if (
i == symbols_)
return;
225 for (j = symbols_; *
i;
i++, j++)
235 char *
str =
new char [symbols_.size () + 1];
237 strcpy (
str, symbols_.c_str ());
246 reverse (symbols_, symbols_ + strlen (symbols_));
248 reverse (symbols_, symbols_ + strlen (symbols_));
253 char *
str =
new char [symbols_.size () + 1];
255 strcpy (
str, symbols_.c_str ());
268 for (
i = j = symbols_; *
i;
i++)
272 for (s = c_; *s; s++)
292 char *
str =
new char [symbols_.size () + 1];
294 strcpy (
str, symbols_.c_str ());
305 for (
i = symbols_; *
i;
i++)
307 if (*
i == cIn_) *
i = cOut_;
313 char *
str =
new char [symbols_.size () + 1];
315 strcpy (
str, symbols_.c_str ());
326 if (! symbols_ || ! *symbols_)
return;
327 if (symbols_ [strlen (symbols_) - 1] ==
'\r') symbols_ [strlen (symbols_) - 1] =
'\0';
334 if (symbols_.empty ())
return;
335 if (*symbols_.rbegin () ==
'\r') symbols_.erase (symbols_.size () - 1);
340 assert (strlen (symbols_) != 0);
366 strcpy (symbols_,
str.c_str ());
371 char *
str =
new char [symbols_.size () + 1];
373 strcpy (
str, symbols_.c_str ());
381 std::vector <std::string> *strVec_,
386 assert (split_.length () != 0);
391 string::size_type pos0 = 0;
393 for (string::size_type pos =
str.find (split_ [0]); pos != string::npos && pos !=
str.length (); )
395 if (
str.substr (pos,
min (split_.length (),
str.length () - pos)) != split_) {
401 strVec_->push_back (pos == pos0 ?
string (
"") :
str.substr (pos0, pos - pos0));
402 pos += split_.length ();
406 strVec_->push_back (
str.length () == pos0 ?
string (
"") :
str.substr (pos0,
str.length () - pos0));
413 std::vector <std::string> strVec;
415 split (&strVec, str_, split_);
417 return strVec.size ();
void toUpper(char *symbols_)
bool isAllWhiteSpace(const std::string &symbols_)
bool isNoWhiteSpace(const char *symbols_)
void eraseFinalWhiteSpace(char *symbols_)
void eraseCarriageReturn(char *symbols_)
void eraseFinalChar(char *symbols_, const char *c_)
size_t splitCount(const std::string &str_, const std::string &split_)
void eraseInitialWhiteSpace(char *symbols_)
void split(std::vector< std::string > *strVec, const std::string &str_, const std::string &split_)
bool isAlpha(const char *symbols_)
void eraseInitialChar(char *symbols_, const char *c_)
bool isUpper(const char *symbols_)
void substituteChar(char *symbols_, const char cOut_, const char cIn_)
void whiteSpace2UnderScore(char *symbols_)
void eraseWhiteSpace(char *symbols_, bool eraseBlankOnly_=false)
void toLower(char *symbols_)
bool isLower(const char *symbols_)
void eraseChar(char *symbols_, const char *c_)
bool isReplicate(const std::string &symbols_, bool upperEqualsLower_=false)
static const char * str(char *buf, int n)