July 2017
Intermediate to advanced
434 pages
12h 59m
English
You can select a portion of a variable's value, (just like a substr function in many programming languages) by wrapping the variable in ${var:offset:length} tags. The arguments are:
Some examples of the arguments are as follows:
set data="varname=1234567890"
${varname:offset:length}
${varname:0:1} // 1
${varname:1} // 234567890
${varname:-4} // 7890
${varname:-4:2} // 78
${varname:4:2} // 56
An extension showing a variable and its substring: ...
Read now
Unlock full access