Ide editor ToUpper/Lower/InitCaps/SwapCase

git-svn-id: svn://ultimatepp.org/upp/trunk@649 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-11-17 12:57:08 +00:00
commit c14a08e5c6
6 changed files with 77 additions and 1 deletions

View file

@ -1623,6 +1623,22 @@ WString InitCaps(const wchar *s)
return r;
}
WString InitCaps(const WString& s)
{
WStringBuffer r;
r.SetCount(s.GetCount());
bool spc = true;
for(int i = 0; i < s.GetCount(); i++) {
int c = s[i];
if(spc)
r[i] = ToUpper(c);
else
r[i] = ToLower(c);
spc = IsSpace(c);
}
return r;
}
WString ToUpper(const WString& w)
{
int l = w.GetLength();