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/63c7c676-0965-4fdb-914d-18c1a9df2116%40googlegroups.com.

Reply via email to