Previous Topic: ABS Function--Find the Absolute Value

Next Topic: ALL Function--All Bits Set

AFTER Function--Find a String

The AFTER function finds the specified instance of a search string in a source string and returns that part of the source string that follows the search string. If the search string is not found, then the AFTER function returns a blank string.

Syntax

The AFTER function has the following format:

AFTER(source_string, search_string[, not_case_sensitive][, n])

Parameters

The AFTER function accepts the following parameters:

source_string (string)

search_string (string)

not_case_sensitive (Boolean)

(Optional) Specifies case sensitivity. If the not_case_sensitive flag is omitted or set to FALSE, the function searches the source string for an exact match. If the not_case_sensitive flag is set to TRUE, the function ignores case.

n (number)

(Optional) Specifies the instance of the search string in the source string. If n is set to zero or one or omitted, the function finds the first instance of the search string. Otherwise, the function finds the nth instance of the search string. If n is negative, the function begins the search at the end of the source string.

Return Value

The AFTER function returns a string.

Example

Return_value=AFTER('EricEric', 'r')
Return_value='icEric'

Return_value=AFTER('EricEric', 'R')
Return_value=''

Return_value=AFTER('EricEric', 'R', TRUE)
Return_value='icEric'

Return_value=AFTER('EricEric', 'r', -1)
Return_value='ic'

Return_value=AFTER('EricEric', 'R', -1)
Return_value=''

Return_value=AFTER('EricEric', 'R', TRUE, -1)
Return_value='ic'

Return_value=AFTER('EricEric', 'r', 2)
Return_value='ic'

Return_value=AFTER('EricEric', 'R', 2)
Return_value=''

Return_value=AFTER('EricEric', 'R', TRUE, 2)
Return_value='ic'

More information:

BEFORE Function--Find a String

FIND Function--Return Position in String


Copyright © 2010 CA. All rights reserved. Email CA about this topic