> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/s/strip_a_set_of_characters_from_a_string.md).

# Strip a set of characters from a string

```ruby
func stripchars(str, char_list) {
    str.tr(char_list, "", "d")
}
```

or:

```ruby
func stripchars(str, char_list) {
    str.chars.grep {|c| !char_list.contains(c)}.join
}
```

Calling the function:

```ruby
say stripchars("She was a soul stripper. She took my heart!", "aei")
```

#### Output:

```
Sh ws  soul strppr. Sh took my hrt!
```
