>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  STREP
Libraries

STREP

STREP

Name


      STREP

Purpose


      Edit a string by position. Precede, Follow, Replace, Delete.

Category


Calling Sequence


      newstring = strep(string,cmd,p,ss,[iflg])

Inputs


      string = string to edit. in
      cmd = edit command: in
        'P' = precede position p with substring ss.
        'F' = follow position p with substring ss.
        'R' = replace text starting at position p
              with text from substring ss.
        'D' = delete N characters starting at
              position p. The calling sequence for
              this command is slightly different:
              IFLG = STREP(string,'D',p,n,[iflg])
              Where n = number of characters to delete.
      p = character position to use. in
          0 = first char. Any number larger
          than the string length = last char.
      ss = substring to use. For 'D' command in
            n is used instead of ss.

Keyword Parameters


Outputs


      iflg = 0 for a successful edit, out
      iflg = -1 for an error and no change to string.
      newstring = edited string. out

Common Blocks


Notes


Modification History


      Written by R. Sterner, 27 Dec, 1984.
      Converted to SUN 13 Aug, 1989 --- R. Sterner.
      R. Sterner, 2010 Apr 29 --- Converted arrays from () to [].
      R. Sterner, 2010 Dec 20 --- Fixed 'P', 'F', and 'R' for ss=NULL string.
          Null string was terminating the string where inserted (since 1984).
  Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us