Your IP : 216.73.216.48
# $EPIC: after,v 1.6 2003/09/22 20:31:00 nsx Exp $
Synopsis:
$after([<count>] <char> <text>)
Technical:
* The <count> argument is optional, the default value is 1. <count> must
be some non-zero number to be recognized as a count. If <count> is 0,
it will be taken as the <char> argument, and <count> will default to 1!
* If <count> is positive, then the return value of this function is the
trailing portion of <text> that is after the <count>th occurrence of any
of the characters in <char>.
* If <count> is negative, then the return value of this function is the
trailing portion of <text> that is after the <count>th-to-last occurrence
of any of the characters in <char>. (eg. counting backwards from the end)
Practical:
There are many cases where you need to break apart strings that contain
certain characters as delimiters. The $userhost() function returns a
"user@host" and if you want the hostname, then $after(@ $userhost())
will give it to you. If you want the username, check out $before().
Returns:
The input string <text> after the <count>th occurrence of any character
in <char>. The default value for <count> is 1. Negative <count>s
count going backwards from the end.
History:
This function first appeared in "+10" (post ircII, pre-EPIC).
Support for the <count> argument first appeared in "+11"
Examples:
$after(@ hop!jnelson@wicked.neato.org) returns "wicked.neato.org"
$after(-1 ! hop!jnelson@wicked.neato.org) returns "jnelson@wicked.neato.org"
$after(-2 . hop!jnelson@wicked.neato.org) returns "neato.org"
$after(2 . hop!jnelson@wicked.neato.org) returns "org"
$after(3 !@. hop!jnelson@wicked.neato.org) returns "neato.org"