Index:
[thread]
[date]
[subject]
[author]
From: Garrett Mitchener <wgm2@acpub.duke.edu>
To :
Date: 11 Feb 1999 12:39:18 -0500
Re: tolower & other useful string functions....
Michael Abernethy <mna@duke.edu> writes:
> I've looked through the STL and not found anything.
> I think writing the functions yourself wouldn't be that difficult.
>
> something like
>
> void lowercase(string & str)
> {
> int i;
> for (i=0; i<str.size(); i++)
> {
> if (str[i] < 'a')
> str[i] = str[i] +('a' - 'A');
> }
> }
>
> >
You might prefer to use the character conversion functions in
<ctype.h> They are portable to non-ASCII character sets and accented
characters, etc.
-- Garrett :-)
Index:
[thread]
[date]
[subject]
[author]