Thanks for pointing that out Jeremy. I have an immediate use for this and am anxiously waiting for the 5.1.23 release!
Damon On Tuesday, November 17, 2020 at 10:28:54 AM UTC-7 [email protected] wrote: > One of my personal TiddlyWiki’s contains song lyrics and chords, with the > default tiddler displaying a list of the songs sorted by title. It’s been > annoying for a long time that the titles starting “The …” are sorted under > “T”, and not the first letter of the following word. > > The new sortsub operator in v5.1.23 has provided a simple means to resolve > things: > > \define sort-filter() [<currentTiddler>removeprefix[the ]] > ~[<currentTiddler>removeprefix[The ]] ~[<currentTiddler>] > > <$list filter="[tag[song]sortsub<sort-filter>]" > template="$:/_SongItemTemplate"/> > > > The subfilter relies on the fact that the removeprefix operator doesn’t > return anything if the input string doesn’t start with the specified > prefix. Thus we can step through the prefixes we want to remove, finishing > up with the original title. > > A more complete version should perhaps strip the prefix “A ” as well. > > It would be nicer if we have a case-insensitive version of removeprefix. > > Best wishes > > Jeremy > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/073a9d05-5c0b-449d-bc1b-bf5f108e2597n%40googlegroups.com.

