Trim blanks inside of string

230 pts.
Tags:
RPG RPG FREE ILE AS/400
How do you %Trim blanks inside of string? 

Example  Fld1 = '0 0 ' need to strip the blanks out.
Example  Fld2 = '0   0' need to strip the blanks out.


1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check out the IBM %SCANRPL function. Just replace the double space with a single space. You may have to loop through the process a few times if you are trying to remove more that just a double space. Withe that or code for each variety and test largest to smallest.

Example. Scan for 5 spaces, then scan for 4 spaces, then 3 and lastly 2 spaces. 

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: