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

Discuss and share scripts and script files...
Post Reply
MBaas
Posts: 572
Joined: 15 Feb 2016 21:08

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

Post 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);
______________________________________________
Happy user ;-)

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

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

Post 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");
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

MBaas
Posts: 572
Joined: 15 Feb 2016 21:08

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

Post by MBaas »

I want to use the result with popupnested, so trimming would remove the spaces needed for proper indenting...
______________________________________________
Happy user ;-)

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post by highend »

Why creating spaces in the first place...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

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

Post by klownboy »

Try using SC replace: text replace("Hello|| | | |world"," ", "");
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply