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

Source code in the emacs programming language

(defun stripchars (s chars)
  (seq-into
   (seq-filter (lambda (x) (not (seq-contains chars x))) s)
   'string))

(stripchars "She was a soul stripper. She took my heart!" "aei")


  

You may also check:How to resolve the algorithm Sort a list of object identifiers step by step in the Lua programming language
You may also check:How to resolve the algorithm Semiprime step by step in the C programming language
You may also check:How to resolve the algorithm ABC problem step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Magic squares of singly even order step by step in the Julia programming language
You may also check:How to resolve the algorithm Include a file step by step in the 6502 Assembly programming language