MID Function

The MID/MIDB function is one of the text and data functions. Is used to extract the characters from the specified string starting from any position. The MID function is intended for languages that use the single-byte character set (SBCS), while MIDB - for languages that use the double-byte character set (DBCS) like Japanese, Chinese, Korean etc.

Syntax

MID(text, start_num, num_chars)

The MID function has the following arguments:

ArgumentDescription
textA string you need to extract the characters from.
start_numA position you need to start extracting from.
num_charsA number of the characters you need to extract.

MIDB(text, start_num, num_bytes)

The MIDB function has the following arguments:

ArgumentDescription
textA string you need to extract the characters from.
start_numA position you need to start extracting from.
num_bytesA number of the characters you need to extract, based on bytes.
Notes

How to apply the MID/MIDB function.

Examples

The figure below displays the result returned by the MID function.

MID Function

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags