Brian Dunning's FileMaker Custom Functions

RightSeparator ( text ; separator ; occurrence ; direction )

Returns the characters in text counting from the right to the specified occurrence of the separator.

  Average rating: 3.8 (51 votes) Log in to vote

Kurt Otto   Kurt Otto - Show more from this author
ottopiaDESIGN
http://ottopia.dyndns.org/

Share on Facebook Share on Twitter

  Sample input:
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 0 )
  Sample output:
ccc

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

Format
------
RightSeparator ( text ; separator ; occurrence ; direction )

Parameters
----------
text - any text expression or text field.
separator - any text expression or text field representing the set of characters you want to find.
occurrence - any numeric expression or field containing a number, representing which instance of the text string you want to find.
direction - 0 to count from right, 1 or greater to count from left.

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

Description
----------
Returns the characters in text counting from the right to the specified occurrence of the separator. The direction parameter determines
if the specified occurrence is counted from the left or the right of text.

Examples
--------
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 0 ) returns ccc
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 2 ; 0 ) returns bbb:ccc
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 3 ; 0 ) returns ""
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 1 ; 1 ) returns bbb:ccc
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 2 ; 1 ) returns ccc
RightSeparator ( "aaa:bbb:ccc" ; ":" ; 3 ; 1 ) 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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: