Extracts a portion of a string.
string MID(string value, int start, int num)
string MID(string value, int start)
Object | Data Type | Description |
---|---|---|
value | String | A string. |
start | Integer | A number identifying the start position in the string. |
num | Integer | The number of letters to take from the start position. |
MID("Account", 2, 4)
Will return "coun".
or
Another example could be that you know that your productID's always start with the same five digits and a "-" and you only want to return the digits after the first 5 e.g. "12345-abc345":
MID(ProductID, 7)
This will return everything after the "-" from the 7th position in the string, as the "-" is at the 6th position. Using the example above this will return "abc345". By not stating how many characters you wish to count it will return all until the end of the sequence.