| Richard 2007-11-01, 6:55 pm |
| On Nov 2, 7:29 am, vferr...@alumni.uottawa.ca wrote:
> William M. Klein wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hey guys!
>
> Well, I tried the suggestion above, and sure enough it worked.
>
> I am sorry for not originally describing the problem very clearly. It
> was somewhere along the lines...
>
> I have a string say- ' big fresh a apple'
> I needed to scrapout the a and replace it with a space, I realize this
> will give me double spaces, but I have a routine later that scrubs off
> additional spaces, which was why I didnt care.
Do it in a loop with UNSTRING .. DELIMITED BY SPACE .. WITH
POINTER .., check each word for being a single character and assemble
the result string with STRING .. WITH POINTER .. (not same pointer of
course).
MOVE 1 TO InP OutP
MOVE SPACES TO OutS
PERFORM UNTIL InS(InP:) = SPACES
UNSTRING InS DELIMITED BY SPACE
INTO Word
WITH POINTER InP
IF ( InS(2:1) NOT = SPACE )
STRING Word DELIMITED BY SPACE
" " DELIMITED BY SIZE
INTO OutS
WITH POINTER OutP
END-IF
END-PERFORM
|