Remove few characters from title

50 views
Skip to first unread message

Mohammad

unread,
Feb 17, 2019, 1:27:33 AM2/17/19
to tiddl...@googlegroups.com
Using the current filter operators how is it possible to select, or split the first three characters of a title, how this can be done for the last three chacarters?

Example
Mytitle > itle
Mytitle > Myti

Cheers
Mohammad

TonyM

unread,
Feb 17, 2019, 1:46:48 AM2/17/19
to TiddlyWiki
I think you meant "characters"?

Mal

unread,
Feb 17, 2019, 1:50:30 AM2/17/19
to TiddlyWiki
Mahommad,

How about:

[[Mytitle]split[]rest[3]join[]]

It only works in 5.1.20 prerelease and uses a similar approach to my answer in this thread:  produce zero padded number using RANGE operator.

Regards,

Mal

Mohammad

unread,
Feb 17, 2019, 1:50:45 AM2/17/19
to TiddlyWiki
That's true Tony!
Sending from cell phone caused that misspelled auto correct!!

--Mohammad

Mohammad

unread,
Feb 17, 2019, 2:44:48 AM2/17/19
to TiddlyWiki
Wonderful Mal,
 How about removing last three chars?


See this based on your solution

\define remtitle(MyTitle:"")
<$text text={{{ [<__MyTitle__>split[]rest[3]join[]] }}} />
\end

<<remtitle mohammad>>
<<remtitle ali43>>

ammad



43


Mal

unread,
Feb 17, 2019, 2:54:59 AM2/17/19
to TiddlyWiki
To remove last 3 characters, replace "rest" with "butlast".

Regards,

Mal

Mohammad

unread,
Feb 17, 2019, 3:06:23 AM2/17/19
to TiddlyWiki
Mal,
 Thank you! It works.
I gonna use it in Commander for title operation.

Best
Mohammad

Mal

unread,
Feb 17, 2019, 3:32:03 AM2/17/19
to TiddlyWiki
Mohammad,

Just keep in mind that split and join are new operators being introduced in 5.1.20 and I don't know if their behaviour is fully locked in yet.

Mal

Mohammad

unread,
Feb 17, 2019, 3:58:50 AM2/17/19
to TiddlyWiki
Mal,
 Many thanks for the hint!

--Mohammad
Reply all
Reply to author
Forward
0 new messages