Eric, I support your suggestion, in effect the trim default is "leading/trailing whitespace" but you can trim other values with this suggestion.
It is true more often that not removeprefix and removesuffix work for me, but they are long operators. If trim was the equivalent of remove prefix I would like it. With the increasing use by many, of the tipple curly braces to construct parameters from filters (Variables and References) a "trim/simple" trim operator would make them much shorter and more readable. >From memory unless remove prefix removes the prefix the title will not appear in the result. Trim on the other-hand trims if so, but passes all titles on. I understand that is what Mats "less Greedy" reference is about. The existing split and join are related functions and I wonder if what you are suggesting is just a subset of some other operators that would be useful. What you propose can sometimes be achieved with the split operator, but without a way to use white space rules. This is because the split text is removed from the output. I have always felt it would be nice to have a replace operator replace "string with string" which also understood whitespace so you could say replace whitespace with / to generate a tiddler title, or replace "/" with white-space to extract subtitles. The Question is would this be the way to gain the functions you suggest? Ideally you trim proposal AND others would be implemented. It feels we have almost all we need but not everything. Workarounds are not helpful if you need a TiddlyWiki degree to design them. Regards Tony On Wednesday, July 1, 2020 at 4:42:58 AM UTC+10, Eric Shulman wrote: > > On Tuesday, June 30, 2020 at 10:30:05 AM UTC-7, Mat wrote: >> >> Good idea but/and I think this request has overlapping use; >> Extend removeprefix op with :suffix to make less greedy #4520 >> <https://github.com/Jermolene/TiddlyWiki5/issues/4520> >> > > That issue is very similar to my proposal, but would mean adding ":lazy" > handling to both removeprefix[] and removesuffix[], and wouldn't address > the "repeating character" functionality in my proposal. > > I think that extending the trim[] operator makes more sense semantically, > in that it already functions as a "modify but don't remove" operation and > my proposal merely extends this to allow greater specificity without > changing the overall purpose. > > -e > -- 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/65ce3f0c-9069-419b-8ad1-f99989a5d181o%40googlegroups.com.

