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

Source code in the excel programming language

exceptChars
=LAMBDA(excluded,
    LAMBDA(src,
        CONCAT(
            FILTERP(
                LAMBDA(c,
                    ISERROR(
                        FIND(c, excluded, 1)
                    )
                )
            )(
                CHARSROW(src)
            )
        )
    )
)


CHARSROW
=LAMBDA(s,
    MID(s,
        SEQUENCE(1, LEN(s), 1, 1),
        1
    )
)


FILTERP
=LAMBDA(p,
    LAMBDA(xs,
        FILTER(xs, p(xs))
    )
)


  

You may also check:How to resolve the algorithm String matching step by step in the zkl programming language
You may also check:How to resolve the algorithm Factorial step by step in the zkl programming language
You may also check:How to resolve the algorithm Determine if a string is numeric step by step in the min programming language
You may also check:How to resolve the algorithm Empty string step by step in the BASIC programming language
You may also check:How to resolve the algorithm Longest common substring step by step in the Maple programming language