ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/oopse-1.0/libmdtools/StringUtils.cpp
Revision: 1447
Committed: Fri Jul 30 21:01:35 2004 UTC (19 years, 11 months ago) by gezelter
File size: 492 byte(s)
Log Message:
Initial import of OOPSE sources into cvs tree

File Contents

# Content
1 #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 }