Brian Dunning's FileMaker Custom Functions

MiddleSeparator ( text ; separator ; startOccurrence ; endOccurrence )

Returns the characters in text counting between the position of the specified start occurrence of the separator to the specified end occurrence of the separator.

  Average rating: 4.0 (32 votes) Log in to vote

Kurt Otto   Kurt Otto
ottopiaDESIGN
http://ottopia.dyndns.org/

Share on Facebook Share on Twitter

  Sample input:
MiddleSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 2 )
  Sample output:
bbb

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Format
------
MiddleSeparator ( text ; separator ; startOccurrence ; endOccurrence )

Parameters
----------
text - any text expression or text field.
separator - any text expression or text field representing the set of characters you want to find.
startOccurrence - any numeric expression or field containing a number, representing the start instance of the text string you want to find.
endOccurrence - any numeric expression or field containing a number, representing the end instance of the text string you want to find.

Data type returned
----------------
text

Description
----------
Returns the characters in text counting between the position of the specified start occurrence of the separator to the specified end occurrence of the separator.

Examples
--------
MiddleSeparator ( "aaa:bbb:ccc" ; ":" ; 0 ; 2 ) returns ""
MiddleSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 2 ) returns bbb
MiddleSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 3 ) returns ""

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.