Remove unwanted large spaces in string value

kasundha

Member
I need to remove large spaces from a given string value before updating the db.

eg: -
'PTPPromise to Pay :- 07/05/2019 , 13500.00 , Walk In , , RelativesMet customer wife .

T.p.0702462817.'
 

Cringer

ProgressTalk.com Moderator
Staff member
That doesn't look like just spaces. It looks like there are also line breaks in there. So what constitutes a large space, as RHD says?
 
I need to remove large spaces from a given string value before updating the db.

eg: -
'PTPPromise to Pay :- 07/05/2019 , 13500.00 , Walk In , , RelativesMet customer wife .

T.p.0702462817.'

Code:
DEF VAR i AS INTEGER NO-UNDO.
DEF VAR c AS CHAR NO-UNDO.
c = "your           text".
DO i = 1 TO 15:
  c = REPLACE(c,"  "," "). /* first "" with 2 spaces, second "" with 1 space */
END.
 
Top