How to: Reference: |
The STRREP replaces all instances of a specified string within a source string. It also supports replacement by null strings.
STRREP (inlength, instring, searchlength, searchstring, replength, repstring, outlength, output)
where:
Numeric
Is the number of characters in the source string.
Alphanumeric
Is the source string.
Numeric
Is the number of characters in the (shorter length) string to be replaced.
Alphanumeric
Is the character string to be replaced.
Numeric
Is the number of characters in the replacement string. Must be zero (0) or greater.
Alphanumeric
Is the replacement string (alphanumeric). Ignored if replength is zero (0).
Numeric
Is the number of characters in the resulting output string. Must be 1 or greater.
Alphanumeric
The maximum string length is 4095.
STRREP finds and replaces commas and then dollar signs and stores the result in field with the format A17:
STRREP(15,CS_ALPHA,1,',',0,'X',14,'A14') STRREP(14,CS_NOCOMMAS,1,'$',4,'USD ',17,'A17')
For $29,700.00, the result is USD 29700.00.
For $9,000.00, the result is USD 9000.00.
iWay Software |