Hello,

In "rewrite results" the checkbox "remove whitespace" return strings with spaces.

Also twig doesn't work:
{{ term_node_tid__name|render|lower|trim }}
{{ term_node_tid__name|lower|trim }}
{{ term_node_tid__name|trim }}
{{ term_node_tid__name|trim(' ') }}
(but 'lower' works)

What can I check?

Module version: 8.1.8
Drupal version: 8.1.8
(missing versions in issue creation, maybe I'm in the wrong forum section??)

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frazac_naba created an issue. See original summary.

zalak.addweb’s picture

Issue tags: +views
Lendude’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.3.x-dev
Component: Miscellaneous » views.module
Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)
Issue tags: -views

Moving to the right queue (that should also reveal the right versions).

Trim only removes whitespace characters from the front and back of a string, not from inside a string. I don't think there is currently an option to remove whitespace from the string as a whole.

Does this answer your question?

frazac_naba’s picture

Thanks Lendude! Sorry but it doesn't reply.
Maybe for my ignorance: what is the front or the back of a string?

Here a bettere explication:

Input from the field of a node:
"I'm foo"
View output expected whit "remove whitespace" activated:
"I'mfoo"
But this not happens!

Bye

Lendude’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Remove whitespace only removes any whitespace at the start and at the end of your text so " I'm foo " becomes "I'm foo"

See the php trim function

Views rewrite doesn't support the thing you are trying to do.

frazac_naba’s picture

Ok, all right thanks.