MIDB

Syntax:

MIDB ( string , start-pos , number-bytes )

Description: Extracts number-bytes-worth of characters from string, starting at character position start-pos. (MIDB is intended for use with languages that use the double-byte character set (DBCS), whereas MID3.17.7.208) is intended for use with languages that use the single-byte character set (SBCS).)

Arguments:

Name

Type

Description

string

text

Designate the string from which a substring is to be extracted.

number-bytes

number

The number of characters to be extracted. number- bytes shall be at least 0.

start-pos

number

The starting position within string, where the first byte is position 1. If start-pos is greater than the length of string, or if start-pos and number- bytes combined exceeds the length of string, the whole of string shall be extracted.

Return Type and Value: text – A string containing number-bytes-worth of characters from string, starting at character position start-pos.

However, if

  • start-pos < 0, #VALUE! is returned.

  • number-bytes < 0, #VALUE! is returned.

example: