How to trim whitespace

Created on 12 April 2024, 12 months ago
Updated 25 April 2024, 11 months ago

Problem/Motivation

There is a Characters to trim plugin that doesn't trim whitespace?!

  • Example string: authenticated, administrator (which is coming from [user:roles:keys])
  • Example need: feed that into a Views' contextual filter, which accepts multiple arguments in the form of arg1+arg2 (OR condition) or arg1,arg2 (AND condition), but without spaces in between!

What you can do:
Plugin, setup => result:

  1. Characters to trim, trim , or nothing (blank should mean remove spaces) => authenticated, administrator = ❌ no trim (but this is useful to remove all spaces but one, as in normal sentences)
  2. Find Replace, find , replace with , => authenticated, administrator = ❌ no replacement (with any combination of plugin options)
  3. Find Replace REGEX, find /, / replacement , => authenticated,administrator = ✅ it works, yay!
💬 Support request
Status

Needs review

Component

Documentation

Created by

🇮🇹Italy kopeboy Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024