Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var prepositions = ["on", "in", "at", "since", "for", "ago", "before", "to", "past", "to", "till", "until", "till", "until", "by", "in", "at", "on", "by, next to, beside", "under", "below", "over", "above", "across", "through", "to", "into", "towards", "onto", "from", "from", "of", "by", "on", "in", "off", "out of", "by", "at", "about"];
- var articles = ["a", "an", "the"];
- var grammars = prepositions.concat(articles);
- var grammarRegex = new RegExp('\\b(' + grammars.join('|') + ')\\b', 'gi');
- var redundantSpaceRegex = /\s+/g;
- var quote = "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.";
- quote = quote.replace(regex, '').replace(redundantSpaceRegex, ' ').trim();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement