This works very similar (almost exactly) to PHP substr function
See https://www.w3schools.com/php/func_string_substr.asp

--Mohammad

On Saturday, March 28, 2020 at 11:59:29 PM UTC+4:30, Mohammad wrote:
>
> This seems the fail-safe one
>
> \define substr(string, start:0, length)
> <$vars Length={{{ 
> [[$length$]!is[blank]then[$length$]]~[[$string$]length[]] }}}  >
> <$text text={{{ 
> [<__string__>split[]butfirst<__start__>first<Length>join[]] }}} />
> </$vars>
> \end
>
>
> See these examples:
>
> # <<substr>>
> # <<substr string:"Test">>
> # <<substr start:1>>
> # <<substr length:2>>
> # <<substr string:"Test" length:2>>
> # <<substr string:"Test" start:1 length:2>>
> # <<substr string:"Test" start:-4 length:2>>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0d85a858-1769-44eb-8ac3-c25fa4e997c5%40googlegroups.com.

Reply via email to