findSubStringBTF
Finds a sub string (Back To Front) within 'content', starts searching from the beginning till 'to' and then finding the nearest 'from' seaching backwards.
case-sensitive strings. 'from' and 'to' will be excluded from the result.
Syntax
findSubStringBTF
Returns
returns (string) the substring if found
Parameters
- content (string)
- the main string to search in
- to (string)
- the string to end the result with
- from (string)
- (optional) the case sensitive string to find, nearest to the 'to' and start the result from. else the full up 'to' result will be returned.
Usage
example:
echo(findSubStringBTF("abcdefghijklmnopqrstuvwxyz", "tuv"));
echo(findSubStringBTF("abcdefghijklmnopqrstuvwxyz", "tuv", "def"));
echo(findSubStringBTF("abcdef123-a-456abcdef123-b-456", "45", "23"));
output:
abcdefghijklmnopqrs
ghijklmnopqrs
-a-