Synopsis:
partial_string=strsub(str,start_pos[,end_pos])
Arguments:
str - The string to extract partial string from
start_pos - The starting position from which to extract the partial string (first character is numbered 1)
[end_pos] - Optional ending position for the partial string extraction
Description: This function extracts a partial string from the given str using the start_pos and end_pos to specified the offsets in the str from which to obtain the partial string to return. The start_pos must hold a value between 1 and the total number or characters in the string. The optional end_pos should hold a value between 1 and the total number or characters in the string and must be greater than or equal to the start_pos. If end_pos is not specified then it defaults to the offset of the last character in the given string and so the partial string returned will be from the start_pos to the end of the given str.
If invalid start_pos or end_pos values are given (such as negative values, start_pos > end_pos, start_pos past end of string etc) then the function will return an empty string.
For example:
string="ABC123ZYX"
// This will return ABC
part_str=strsub(string,1,3);
// This will return 123
part_str=strsub(string,4,6);
// This will return A
part_str=strsub(string,1,1);
// This will return 123ZYZ
part_str=strsub(string,4);
Returns: Returns the partial string as sepcifed by the start_pos and end_pos or an empty string if invalid parameters are passed.