Navigation :
Envision Language
Lokad Platform
Envision Gallery
Envision Reference
- Glossary
- Selectors
- Tile syntax
- List of icons
- StyleCode sub-language
-
_
-
A-B-C
-
D-E-F
-
G-H-I
-
J-K-L
-
M-N-O
-
P-Q-R
-
S-T-U
-- same
-- sample
-- sanitize
-- scalar
-- scan
-- scatter
-- sequenceUrl
-- show
-- sin
--
single (disambiguation)
-- slicepicker
-- Slices
-- sliceSearchUrl
-- slicetree
-- sliceUrl
-- small
-- smooth
-- smudge
-- solve.moq
-- sort
-- span
-- spark
-- sqrt
-- startsWith
-- stdev
-- stdevp
-- stockrwd.c
-- stockrwd.m
-- stockrwd.s
-- strlen
-- substr
-- substr(text, number, number)
-- substr(text, number)
-- sum
-- summary
-- syncUrl
-- table
-- tabs
-- tanh
-- taskUrl
-- text
-- then
-- today
-- transform
-- treemap
-- trim
-- true
-- truncate
-- tryParseDate
-- tryParseNumber
-- tryParseTime
-- tryParseWeek
-- tuple
--
uniform
-- uniform.left
-- uniform.right
-- union
-- upload
-- uppercase
-- URL
-
V-W-X
-
Y-Z
Envision Specifications
Library
Legacy
substr(text, number, number)
substr(text, number, number), function
def const pure substr(source: text, start: number, count: number): text
Returns a sub-value from a source text, a starting position and a length.
source
: the source text
start
: if non-negative, the offset (zero-indexed) from the beginning of source
; otherwise the offset (one-indexed) from the end of source
count
: the length of the extracted text
Examples
source = "Hello World!"
show summary "" with
substr(source, 0, 3) // returns "Hel"
substr(source, -3, 2) // returns "ld"
substr(source, 6, 100) // returns "World!"
substr(source, 100, 257) // returns ""
substr(source, 2, -1) // returns ""
If the targeted segment of characters is partially or completly outside the text value, then the segment is clipped to fit (as illustrated hereinabove).
If count
is negative, the function will return an empty text (as illustrated hereinabove).
See also