You’re looking for the split
operator! If your t.level fields always use the XX.XX
format, then [<currentTiddler>get[t.level]split[.]first[]]
will give you the first half, and [<currentTiddler>get[t.level]split[.]last[]]
will give you the second. You could then define these filters as functions to get quick access to their values as variables:
\function t.level.first() [<currentTiddler>get[t.level]split[.]first[]]
\function t.level.second() [<currentTiddler>get[t.level]split[.]last[]]
which you can then reuse as variables (<<t.level.first>>
or [tag[Things]search:t.level<t.level.first>]
) or—assuming that you have at least one .
in the name of the function, as custom filter operators (like [t.level.first[]is[tiddler]]
).
For more complicated strings, you may also be interested in other order operators like butfirst
, butlast
, nth
, etc. You can also use splitregexp
to split a string at a point defined with a regular expression (so splitregexp[\n]
will split its input at every line break, for instance.)