ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/utils/StringUtils.cpp
Revision: 1490
Committed: Fri Sep 24 04:16:43 2004 UTC (19 years, 9 months ago) by gezelter
File size: 492 byte(s)
Log Message:
Import of OOPSE v. 2.0

File Contents

# User Rev Content
1 gezelter 1490 #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     }