[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


STRTRANS Source code in strtrans.pro

STRTRANS

Name
       STRTRANS
Purpose
       Translate all occurences of one substring to another.
Category
       text/strings
Calling Sequence
       new = strtrans(oldstr,from,to,ned)
Input Parameters
       oldstr -- string on which to operate.              in
                 May be an array.
       from   -- substrings to be translated. May be      in
                 an array.
       to     -- what strings in from should be           in
                 translated to. May be an array.
Keyword Parameters
       /HELP  -- Set this to print useful message and
                 exit.
Output Parameters
       new    -- Translated string. Array if oldstr is    out
                 an array.
       ned    -- number of substitutions performed in     out
                 oldstr.  Array if oldstr is an array.
Common Blocks

Side Effects

Note
       - Any of old, from, and to can be arrays.
       - from and to must have the same number of elements.
Example
       inp='Many*bad!chars+in_here'
       from=['*','!','+','_']
       to  =[' ',' ',' ',' ']
       out = strtrans(inp,from,to,ned)
       Will produce out='Many bad chars in here', and set ned to 4.
Revision History
       $Id: strtrans.pro,v 1.7 2004/06/15 17:25:54 mcraig Exp $
       $Log: strtrans.pro,v $
       Revision 1.7  2004/06/15 17:25:54  mcraig
       Fixed bug in regular expression, changed array notation to square brackets
       Revision 1.6  2004/01/11 01:49:00  mcraig
       Changed format of one array to newer [] style to avoidf conflict with function name in astro library.
       Revision 1.5  2001/11/23 21:14:35  mcraig
       Added keywords /EXTRACT, /PRESERVE_NULL, /REGEX to call to
       strsplit. This comes very close to reproducing the behavior of the
       obsolete routine str_sep.
       Revision 1.4  2001/11/21 19:13:23  mcraig
       Changed str_sep to strsplit. The former is now considered obsolete by RSI.
       Revision 1.3  1996/06/14 20:00:27  mcraig
       Updated Copyright info.
       Revision 1.2  1996/05/09 00:22:17  mcraig
       Sped up significantly by using str_sep to handle the translation.  No longer
       relies on routines fromother user libraries.
       Revision 1.1  1996/01/31 18:47:37  mcraig
       Initial revision
Release
       $Name: Rel_2_1_2 $
Copyright
  Copyright (C) 1996 The Regents of the University of California, All
  Rights Reserved.  Written by Matthew W. Craig.
  See the file COPYRIGHT for restrictions on distrubting this code.
  This code comes with absolutely NO warranty; see DISCLAIMER for details.

Last modified by pro2html on 2004 June 29 at 21:24 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically