How to Remove Carriage Returns (CR) in peoplecode

How to Remove Carriage Returns (CR) in peoplecode

How to Remove Carriage Returns (CR) in peoplecode of peoplesoft. Using peoplecode function is clean() for remove all non-printable characters.

Syntax of clean:  Clean(string)

You can use the clean function to remove all non-printable characters, such as control codes, end of line marks, and unpaired Unicode combining marks, from a text string and returns the result as a String value. It is intended for use on text imported from other applications that contains characters that may not be printable. Frequently, low-level characters appear at the beginning and end of each line of imported data, and they cannot be printed.

Returns

Returns a String value purged of non-printable characters.

Example 1

Because Char(7) (U+0007) is a non-printable character, the following Clean function returns a null string:

&CLEANSTR = Clean(Char(7));

 

Reference: https://docs.oracle.com/cd/E13292_01/pt849pbr0/eng/psbooks/tpcl/chapter.htm?File=tpcl/htm/tpcl02.htm

Posted in Peoplecode, PeopleSoft.