Page 1 of 1

WIBNI formatlist(,e,,) also removed blank items?

Posted: 13 Feb 2021 18:09
by MBaas
I'm building a menu for use with popupnested and I try to "clean" it with formatlist. Unfortunately the "e"-format treats parameters that contain blanks as non-empty and does not remove them. I know, I could use regex to filter those out - but it just thought "wouldn't it be nice if we had an option ('E' comes to mind) which would filter those as well?"

Repro: text formatlist("Hello|| | | |world",e);

Re: WIBNI formatlist(,e,,) also removed blank items?

Posted: 13 Feb 2021 18:42
by klownboy
Are you looking for Hello|world for a result on your example code line? Try using the trim format, "t" along with "e" text formatlist("Hello|| | | |world","et");

Re: WIBNI formatlist(,e,,) also removed blank items?

Posted: 13 Feb 2021 19:28
by MBaas
I want to use the result with popupnested, so trimming would remove the spaces needed for proper indenting...

Re: WIBNI formatlist(,e,,) also removed blank items?

Posted: 13 Feb 2021 20:06
by highend
Why creating spaces in the first place...

Re: WIBNI formatlist(,e,,) also removed blank items?

Posted: 13 Feb 2021 21:08
by klownboy
Try using SC replace: text replace("Hello|| | | |world"," ", "");