Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$%REPLACE^STRING

Draft MDC Standard

7.1.6.6.6 $%REPLACE^STRING

REPLACE^STRING : STRING ( IN : STRING , .SPEC )

$%REPLACE^STRING returns a copy of IN transformed by prioritized substring replacement. For each element e in order by e’s collation sequence, let find be the value of SPEC(e,1) and let out be the value of SPEC(e,2). The function will scan IN for occurrences of the substring find. For each occurrence of find found in IN, if none of the characters in that substring have already been replaced, then the matching substring in IN is replaced with OUT. Otherwise, the found substring is ignored. Processing of each substring is complete when no more unmodified occurrences of that substring can be found in IN; when all of the substrings in SPEC have been processed in order, the resulting string is returned.

Click here for $%REPLACE^STRING sample code.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 14-Nov-2023, 21:34:03.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)