assuming you have a field called mydata
whose value is My Data
:
if the characters you want to remove are always the same (in the example below, My
), you can put this in your tiddler:
<$text text={{{ [{!!mydata}removeprefix[My ]] }}}/>
Small explanation: that code uses a TiddlyWiki widget (<$text text=.../>
) to insert the result of a filter run ([{!!mydata}removeprefix[My ]]
) as text in the output for your tiddler; this (“textifying” the result of the filter run) is done using a filtered transclusion ({{{ }}}
).
if the prefix you want to remove is defined by a more complex criteria (e.g., “remove the first 4 characters”), try something like:
<$text text={{{ [{!!mydata}search-replace:g:regexp[....],[]] }}}/>
(see https://tiddlywiki.com/static/search-replace%20Operator.html for the details of how to use search-replace
)