mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
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:
parent
f52baec9c1
commit
c14a08e5c6
6 changed files with 77 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue