How to resolve the algorithm Strip a set of characters from a string step by step in the Elena 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 Elena 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 Elena programming language

Source code in the elena programming language

import extensions;
import extensions'text;
import system'routines;
 
public program()
{
    var testString := "She was a soul stripper. She took my heart!";
    var removeChars := "aei";
 
    console.printLine(testString.filterBy:(ch => removeChars.indexOf(0, ch) == -1).summarize(new StringWriter()))
}

  

You may also check:How to resolve the algorithm One of n lines in a file step by step in the Elixir programming language
You may also check:How to resolve the algorithm Boolean values step by step in the LiveCode programming language
You may also check:How to resolve the algorithm Rot-13 step by step in the Oz programming language
You may also check:How to resolve the algorithm Interactive programming (repl) step by step in the ML/I programming language
You may also check:How to resolve the algorithm Binary digits step by step in the PL/I programming language