before(
before(
TEXT
,
TAG
)

The before( function extracts all text before a specified tag (sequence of characters). If the tag doesn’t exist the function returns “”.

Parameters

This function has two parameters:

text – the original text

tag – the separator character (or characters).

Description

This function extracts all text before a specified tag (sequence of characters). If the tag doesn’t exist the function returns “”.

    before("john.doe@isp.com","@") ☞ john.doe

Note: This function is equivalent to:

    tagdata(chr(255)+chr(254)+chr(253)+thetext,chr(255)+chr(254)+chr(253),thetag,1)

See Also

- after( -- extracts all text after a specified tag (sequence of characters).
- extract( -- extracts a single data item from a text array, and can also be used to count the number of items in the array.
- firstline( -- extracts the first line from the text.
- firstword( -- extracts the first word from the text.
- lastline( -- extracts the last line from the text.
- lastword( -- extracts the last word from the text.
- left( -- extracts characters from the left edge of the text.
- nthline( -- extracts the nth line from the text.
- nthword( -- extracts a word from the middle of the text.
- randomline( -- returns a random line from multiple lines of text.
- randomword( -- returns a random word from a list of words.
- right( -- extracts characters from the right edge of the text.
- textafter( -- extracts the text after the tag.
- textbefore( -- extracts the text before the tag.
- trim( -- removes characters from the right edge of the text.
- trimleft( -- removes one or more characters from the left edge of the text.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.