home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19238 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.3 KB  |  40 lines

  1. Path: sparky!uunet!wupost!waikato.ac.nz!comp.vuw.ac.nz!acheron.amigans.gen.nz!alien
  2. Newsgroups: comp.lang.c
  3. Subject: Re:  String function names
  4. Message-ID: <alien.029e@acheron.amigans.gen.nz>
  5. From: alien@acheron.amigans.gen.nz (Ross Smith)
  6. Date: 3 Jan 93 13:19:20 GMT+12
  7. References: <1992Dec31.142013.21895@stsci.edu> <28185@dog.ee.lbl.gov> 
  8.  <1993Jan1.032304.14636@organpipe.uug.arizona.edu> <1i0fcaINNgqd@msuinfo.cl.msu.edu>
  9. Distribution: world
  10. Organization: Muppet Labs
  11. Lines: 27
  12.  
  13. In article <1i0fcaINNgqd@msuinfo.cl.msu.edu> learman@cps.msu.edu (Jerome M Learman) writes:
  14. >Does anyone know of a string function that converts all letter in the string to
  15. >lower case letter or all capital letter. I could parse the string char by char
  16. >and use a case statment but I really don't want to do this
  17.  
  18. There isn't a standard function for this. The simplest solution is
  19. something like this :
  20.  
  21. void upstring(char *str)
  22.   {
  23.   char *cptr;
  24.   for (cptr = str; *cptr; cptr++)
  25.     *cptr = toupper(*cptr);
  26.   }
  27.  
  28. ... and similar for lower.
  29.  
  30.  
  31. --
  32. ...... Ross Smith (Wanganui, NZ) ...... alien@acheron.amigans.gen.nz ......
  33.  
  34. "I blame you for the moonlit sky and the dream that died with the Eagle's flight
  35. I blame you for the moonlit nights when I wonder why are the seas still dry
  36. Don't blame me, sleeping satellite"                              (Tasmin Archer)
  37.  
  38. --
  39.  
  40.