View Single Post
Old 06-11-2022, 05:30 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,361
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by TreeFrogBandit View Post
Is there a function I can use to return the first n words of a title (based on separation by spaces)
This.
Code:
{title:sublist(0,4, )}
Note that the spaces are significant.
Quote:
or automatically returns everything before the colon that nearly always sneaks into academic titles?
This.
Code:
{title:sublist(0,1,:)}
You can also combine the two, taking the first N words of the title before a colon. N == 4 in this example.
Code:
{title:'sublist(sublist($, 0, 1, ':'), 0, 4, ' ')'}
chaley is offline   Reply With Quote