Skip to content
Advertisement

How can i remove different strings from one string?

I’ve been searching for a while but other answers are quiet different to what im trying to do. I’m trying to delete prepositions from a string but i wonder if there is any way to delete them without doing it one by one like i’m doing right now: (I’m trying to delete spanish prepositions like (de, del, el, la))

JavaScript

Once i do that the result is:

JavaScript

Could i delete all prepositions at once or i need to do it one by one?

Advertisement

Answer

You can try to use regex

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement