21 Sep
2013
21 Sep
'13
7:43 p.m.
Am 21.09.2013 um 19:11 schrieb Thangalin
Hi,
Most programming languages allow extraction of a character or substring from a string. For example, if I wanted to stylize the word Index:
I... Index ...X
It would be handy to do something like:
\bold{\getcharacter[1]{#!}}... #1 ...\bold{\getcharacter[\stringlength{#!}]}
That is a much more flexible solution than only providing a mechanism to get the first character.
Is this possible?
You can use Lua! \starttext \cldcontext{string.sub("A short example text!",0,1)} \cldcontext{string.sub("A short example text!",3,7)} \cldcontext{string.sub("A short example text!",-5)} \stoptext Wolfgang