1# $EPIC: right,v 1.5 2001/07/11 22:25:49 jnelson Exp $ 2Synopsis: 3 $right(<count> <text>) 4 5Technical: 6 * If <count> is omitted, this function returns the empty string. 7 * If <text> is omitted, this function returns the empty string. 8 * If <count> is less than 0, this function returns the empty string. 9 * If <text> is more than <count> characters long, then this function will 10 return a copy of the last <count> characters in <text>. 11 * If <text> is less than or exactly <count> characters long, then this 12 function will return a copy of <text> 13 14Practical: 15 Whenever you need to extract the trailing part of a string, you would use 16 this function to get it. This is more useful for fixed-format strings. 17 In ircII, you would use $mid($index(<char> <text>) 9999 <text>) to extract 18 the part of <text> that was after <char>. In EPIC, you would use 19 $after(<char> <text>) because it is faster, more clear, does not have any 20 string limits, and avoids having two copies of <text>. This can be 21 important if <text> is a function call. 22 23Returns: 24 The last <count> characters in <text>. No padding is done. If you need 25 a string that is exactly <count> characters, try: 26 $pad(<count> " " $right(<count> <text>)) 27 28Examples: 29 $right(5 biklmnopstv) returns "opstv" 30 $right(15 biklmnopstv) returns "biklmnopstv" 31 $right(-2 biklmnopstv) returns "" 32 $mid($index(@ $userhost()) 999 $userhost()) returns a hostname in an /on. 33 -- Note that this construction is obsolete, but is still used by some. 34 35History: 36 This function first appeared in ircII. 37 38See Also: 39 left(6), after(6), pad(6) 40 41