how to removesuffix and not delete item without this suffix?

50 views
Skip to first unread message

Siniy-Kit

unread,
Jan 19, 2021, 3:24:58 AM1/19/21
to TiddlyWiki
Hi! I have a simple list {{{[enlist[111-hide 222-hide 333-hide 444]removesuffix[-hide]]}}} 
the result of it is 111222333 ,but I want to see 111222333444  is it possible? 

Saq Imtiaz

unread,
Jan 19, 2021, 3:32:15 AM1/19/21
to TiddlyWiki
In 5.1.23 you could try something like this:

[enlist[111-hide 222-hide 333-hide 444]search-replace:ig:regexp[-hide$],[]]

Siniy-Kit

unread,
Jan 19, 2021, 3:45:05 AM1/19/21
to TiddlyWiki
Thank you, Saq.  Is it possible to do something in  5.1.21  ?  

вторник, 19 января 2021 г. в 11:32:15 UTC+3, saq.i...@gmail.com:

Siniy-Kit

unread,
Jan 19, 2021, 3:48:50 AM1/19/21
to TiddlyWiki
very long... {{{[enlist[111-hide 222-hide 333-hide 444]removesuffix[-hide]][enlist[111-hide 222-hide 333-hide 444]!suffix[-hide]]}}} 

вторник, 19 января 2021 г. в 11:32:15 UTC+3, saq.i...@gmail.com:
In 5.1.23 you could try something like this:

Saq Imtiaz

unread,
Jan 19, 2021, 4:15:31 AM1/19/21
to TiddlyWiki
I think the last filter you posted might be your best option in 5.1.21
It is ugly but it works.

You could store the list in a variable.

Michael Wiktowy

unread,
Jan 19, 2021, 9:04:11 AM1/19/21
to TiddlyWiki
Does {{{[enlist[111-hide 222-hide 333-hide 444]split[-hide]!is[blank]]}}} do what you want?

"split" keeps list items that don't match the search term and !is[blank] gets rid of all the empty list items created by each match ... you can glue things back together with join if required.

/Mike
Reply all
Reply to author
Forward
0 new messages