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