home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lang / awk / 22 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.7 KB  |  41 lines

  1. Newsgroups: alt.lang.awk
  2. Path: sparky!uunet!cs.utexas.edu!torn!nott!bnrgate!bcars267!bcars267!emcoop
  3. From: emcoop@bnr.ca (hume smith)
  4. Subject: Re: tolower() function?
  5. In-Reply-To: tbates@austin.ibm.com's message of Mon, 25 Jan 1993 14:39:32 GMT
  6. Message-ID: <EMCOOP.93Jan25124421@bcars148.bnr.ca>
  7. Sender: news@bnr.ca (usenet)
  8. Nntp-Posting-Host: bcars148
  9. Organization: Bell-Northern Research, Ottawa, Canada
  10. References: <EMCOOP.93Jan19111755@bcars148.bnr.ca> <C184vr.p5q@austin.ibm.com>
  11.     <1993Jan22.012739.26965@chpc.utexas.edu>
  12.     <1993Jan24.093340.17437@psg.com> <C1EzDw.FtF@austin.ibm.com>
  13. Date: Mon, 25 Jan 1993 17:44:21 GMT
  14. Lines: 25
  15.  
  16. In article <C1EzDw.FtF@austin.ibm.com> tbates@austin.ibm.com (Tom Bates) writes:
  17.  
  18.    In article <1993Jan24.093340.17437@psg.com>, edw@psg.com (Ed Wright) writes:
  19.    > In article <1993Jan22.012739.26965@chpc.utexas.edu> rshouman@chpc.utexas.edu (Radey Shouman) writes:
  20.    > >In article <C184vr.p5q@austin.ibm.com> tbates@austin.ibm.com (Tom Bates)
  21.    > >writes:
  22.    > >
  23.    > >>Quoting "The AWK Programming Language",
  24.    > >>
  25.    > >>    "The cleanest way to do case conversion in awk is with an array that
  26.    > >>maps each letter...it's better to use...tr"
  27.    > >>
  28.    > >>I often use tr for this very reason. For example:
  29.    > >>
  30.    > >>    echo "HeLlO, wOrLd!" | tr [:upper:] [:lower]
  31.    >  try                         | tr [A-Z] [a-z]
  32.  
  33.    The advantage to using [:upper:] and [:lower:] instead of [A-Z] and [a-z] is
  34.    locale support.  Not everyone uses ASCII and US English.
  35.  
  36. here's a shocker: not all tr's have that notation.  must be an IBMism :-)
  37. --
  38. Hume Smith                                Honour sick and davey cris-cross
  39. hume.smith@acadiau.ca                     McTruloff sentimie
  40. emcoop@bnr.ca                             A parsnip inner pair threes.
  41.