substringFromBeginIndex
The substringFromBeginIndex
NSM predefined
function returns a string that is a substring of the string.
Syntax
substringFromBeginIndex(string,beginIndex)
Parameters
- string
- Specifies the string for which to extract characters.
- beginIndex
- Specifies the index where to start the extraction. It includes the beginIndex. The first character is at index 0. It must be a whole number and must be less than the length of the string specified in string.
Description
The substringFromBeginIndex
NSM
predefined function extracts the characters from the string specified
in string, starting at the index specified in beginIndex,
and returns a string that is a substring of string.
Returns
This function returns a substring of the string specified in string.
Examples
substringFromBeginIndex("10.3.2.1","3") returns "3.2.1" "substringFromBeginIndex("10.3.2.1","10") /* ERROR is thrown here*/ substringFromBeginIndex("5.3.2.1.18","6") returns "1.18 substringFromBeginIndex("10.3.2.1","three") /* ERROR is thrown here*/