Index: [thread] [date] [subject] [author]
  From: Michael Abernethy <mna@duke.edu>
  To  : 
  Date: Tue, 9 Feb 1999 17:24:45 -0500

Re: tolower & other useful string functions....

 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');
      }
 }

> 
> >Does the stl string class support upcase or downcase?  I couldn't
> >find such functions, but ... you never know.  Thanks,
> >
> >- Dave
> 
> I too find myself needing to use a couple of functions that I used
> to use by including the old "strutils.h"
> (specifically: ToLower() and StripWhite() )
> but cant find an analogue in STL.
> Trying to use the strutils.h with the STL implementation of
> strings gives me tonnes of Symbol Referencing errors
> (to be expected, i guess....)
> 
> so, whats the solution? is there a way for me to call those
> two functions without having to re-write them from scratch?
> 
> Thanks in advance!
> 
> AlexZ
> 
> 
> 
> 

Mike Abernethy
www.duke.edu/~mna
IBM Club Cyberblue - www.cybrblu.ibm.com



Index: [thread] [date] [subject] [author]