Part of a string, or the function/method that returns part of a string
substring
functions/methods come in basically two flavours:
- The parameters to the function are
start
index andlength
.- SQL's version uses this flavour, notably using one-based indexing
- The parameters to the function are
start
index andend
index.C
like languages (includingJava
) use this flavour, and all use zero-based indexing
Definition
A
substring
is astring
contained in a givenstring
.The
substring
can start at any index of the givenstring
and finish in any index within the givenstring
following the start.- It can be an empty
string
, the entire givenstring
, or (most likely) a shorterstring
completely encompassed by the givenstring
.