How to resolve the algorithm Strip a set of characters from a string step by step in the Applesoft BASIC programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Strip a set of characters from a string step by step in the Applesoft BASIC programming language

Table of Contents

Problem Statement

Create a function that strips a set of characters from a string.

The function should take two arguments:

The returned string should contain the first string, stripped of any characters in the second argument:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Strip a set of characters from a string step by step in the Applesoft BASIC programming language

Source code in the applesoft programming language

100  LET S$ = "SHE WAS A SOUL STRIPPER. SHE TOOK MY HEART!"
110  LET RM$ = "AEI"
120  GOSUB 200STRIPCHARS
130  PRINT SC$
190  END 
200  REM 
210  REM STRIPCHARS
220  REM 
230  LET SC$ = ""
240  LET SL =  LEN (S$)
250  IF SL = 0 THEN  RETURN 
260  FOR SI = 1 TO SL
270  LET SM$ =  MID$ (S$,SI,1)
280  FOR SJ = 1 TO  LEN (RM$)
290  LET SR$ =  MID$ (RM$,SJ,1)
300  LET ST = SR$ <  > SM$
310  IF ST THEN  NEXT SJ
320  IF ST THEN SC$ = SC$ + SM$
330  NEXT SI
340  RETURN


  

You may also check:How to resolve the algorithm Averages/Root mean square step by step in the Shen programming language
You may also check:How to resolve the algorithm Reverse a string step by step in the Quackery programming language
You may also check:How to resolve the algorithm Array length step by step in the 11l programming language
You may also check:How to resolve the algorithm Cholesky decomposition step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Quine step by step in the C1R programming language