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

Discuss and share scripts and script files...
Post Reply
MBaas
Posts: 654
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 with Screen scaling 100% and W11Pro 24H2 ;-)

klownboy
Posts: 4398
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

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");

MBaas
Posts: 654
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 with Screen scaling 100% and W11Pro 24H2 ;-)

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

klownboy
Posts: 4398
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

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

Post by klownboy »

Try using SC replace: text replace("Hello|| | | |world"," ", "");

Post Reply