ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libmdtools/StringUtils.cpp
Revision: 1422
Committed: Tue Jul 27 18:58:18 2004 UTC (19 years, 11 months ago) by gezelter
File size: 492 byte(s)
Log Message:
Forgot to add them

File Contents

# User Rev Content
1 gezelter 1422 #include "StringUtils.hpp"
2    
3     string UpperCase(const string& S) {
4     string uc = S;
5     unsigned int n = uc.size();
6     for (unsigned int j = 0; j < n; j++) {
7     char sj = uc[j];
8     if (sj >= 'a' && sj <= 'z') uc[j] = (char)(sj - ('a' - 'A'));
9     }
10     return uc;
11     }
12    
13     string LowerCase(const string& S) {
14     string lc = S;
15     unsigned int n = lc.size();
16     for (unsigned int j = 0; j < n; j++) {
17     char sj = lc[j];
18     if (sj >= 'A' && sj <= 'Z') lc[j] = (char)(sj + ('a' - 'A'));
19     }
20     return lc;
21     }