MID(S, N1, N2)

Top  Previous  Next

 

Description

This function returns the string of length N2 that starts at position N1 in string SN1 is the number of characters from the beginning of the string; N1 must be greater than or equal to zero, and less than the length of SN2 must be greater than or equal to zero.  If N1+N2 is greater than the length of S, then the substring starting at position N1 in S is returned.  The first character in string S is taken to be at position zero.

 

Parameters

 

S

A string value.

 

N1

A numeric value.

 

N2

A numeric value.

 

Examples

 

Given:

 

T5 = "Spreadsheet"

 

MID(T5, 6, 5) = "sheet"

 

MID(T5, 10, 1) = "t"

 

MID(T5, 1, 0) = " "

 

Sponsored

Try Predictive Systems Lab

Interactive Demo →

Need Help?
Contact support