outside, outside exclude, outside until, outside until exclude
This function extracts a outside parts of the string either with two character position numbers or matching patterns or a combination of both. It is the opposite part of the middle ... function family where the middle part is removed the string and the left and right parts of the strings put together.
Indirect parameter passing is disabled
3
No. | Type | Description |
---|---|---|
1 input |
valid types | input string or value Attention: If 1st parameter is a parameter set, please refer to outside [parameter set function] instead. |
2 input |
numeral | starting character position Positive: First part of the string ends before the specified character position (0 = blank, 1 = ends after 1st character, etc.) |
Alt. 2 input |
string | starting matching pattern Function outside ...: First part of the string ends including the starting matching pattern. |
3 input |
numeral | character count or ending character position For function names outside and outside exclude, this parameter specifies the number of characters to skip before incling the 2nd part of string. |
Alt. 3 input |
string | ending matching pattern Function outside ...: outside part of the string includes the ending matching pattern. |
Type | Description |
---|---|
string | Extracted substring |
st[] = "The taste of the coffee!";
echo( outside( st[], 13, 4 ), " / ", outside until ( st[], 4, -8 ) );
echo( outside( st[], 99, 1 ), " / ", outside until ( st[], 99, 8 ) ); // full strings
echo( outside( st[], -99, 8 ), " / ", outside until ( st[], -99, 8 ) ); // Begins at 0
echo;
echo( outside( st[], ' taste', 7 ), " / ", outside exclude( st[], 'taste ', 7 ) ); // "of the coffee", "tast of the coffee"
echo( outside( st[], ' taste', 0 ), " / ", outside exclude( st[], 'taste ', 0 ) ); // full string, and without taste
echo;
echo( outside ( st[], 'taste', ' the' ), " / ", outside exclude( st[], 'taste ', 'the ' ) ); //
The taste of coffee! / The coffee!
The taste of the coffee! / The taste of the coffee!
e of the coffee! / of the coffee!
The taste coffee! / The coffee!
The taste of the coffee! / The taste of the coffee!
The taste the coffee! / The coffee!
left [string function]
right [string function]
middle [string function]
outside [parameter set function]