Class Right
- Namespace
- Albatross.Expression.Prefix
- Assembly
- Albatross.Expression.dll
Prefix expression that extracts a specified number of characters from the right side of a string. Takes two parameters: the source string and the number of characters to extract.
public class Right : PrefixExpression, IPrefixExpression, IExpression, IToken
- Inheritance
-
Right
- Implements
- Inherited Members
- Extension Methods
Constructors
Right()
Initializes a new instance of the Right class with name "Right" and exactly two parameters.
public Right()
Methods
Run(List<object>)
Extracts the specified number of characters from the right side of the input string. If the requested count is greater than the string length, returns the entire string.
protected override object Run(List<object> operands)
Parameters
Returns
- object
A string containing the rightmost characters, or the entire string if count exceeds length.
Exceptions
- OperandException
Thrown when the character count is negative.
- FormatException
Thrown when operands cannot be converted to string and integer respectively.