Template:Str left long/doc

The Template:Str_left_long is a general utility, as a string-handling utility template, to extract the left-hand side of long text strings beyond 500 to thousands of characters long, using a Lua script module.

Usage

 * {&#123;str left long|abcdef|3&#125;} gives: abc

Examples

 * gives: ab
 * gives: abcde
 * gives: [nothing]
 * gives:
 * gives:
 * gives: ...59,999 long...

Performance considerations
Because {str_left_long} uses a Lua module, it depends on the speed of the Lua script processing, which in February 2013, ran at the speed of 180 per second for repeated uses of {str_left_long}. By comparison, the wp:parser function {padleft:} runs at over 1,250 per second, to extract the left-hand side of a string, but only up to 500 long.