Print      Open PDF Version of Online Help


Previous Topic

Next Topic

Mid

The Mid function in Expression Builder returns a specified number of characters from a string.

TIP: To determine the number of characters in a string, use the Len function.

Syntax

Mid(string, start, length)

Result Type

String

Arguments

The following table describes the arguments for the function.

Argument

Description

string

The field name or string expression from which the characters are returned. If the string contains Null, a blank string is returned.

start

The field name or expression that specifies the character position in the string at which the length count begins. If the value of the start argument is greater than the number of characters in the string, the Mid function returns a blank string.

length

Optional. The field name or expression that specifies the number of characters to return. If this argument is not used, or the length specified is greater than the number of characters that can be returned, all characters from the start position to the end of the string are returned.

Examples

The following example returns seven characters (Builder), beginning with the twelfth character in a string:

Mid("Expression Builder is easy!!", 12, 7)

The following examples return seven characters, beginning with the twelfth character from a text field that contains the text: Expression Builder is easy!!

Mid('<TextFieldName>',12, 7)

or

Mid([<TextFieldName>],12, 7)

The following example extracts the domain name from an email address:

Mid([<CreatedbyEmailAddress>],FindOneOf([<CreatedbyEmailAddress>], "@") + 1, Len([<CreatedbyEmailAddress>]))

Related Topics

See the following topics for related Expression Builder information:


Published 5/4/2012 Copyright © 2005, 2012, Oracle. All rights reserved. Legal Notices.