MID Function [Visio 2003 SDK Documentation]

Returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.

MID (text, start_num, num_chars)

text The text string that contains the characters you want to extract.

start_num The position of the first character you want to extract. The first character in the text string is position 1.

num_chars The number of characters to return.

Remarks

If start_num is:

  • Greater than the length of text, MID returns "" (empty text).
  • Less than the length of text, but start_num plus num_chars exceeds the length of text, MID returns the characters up to the end of text.
  • Less than 1, MID returns the #VALUE! error value.

If num_chars is negative, MID returns the #VALUE! error value.

Example

MID ("SSN 999-99-9999",5,11)

Returns 999-99-9999.