Class Substring

All Implemented Interfaces:
PostfixMathCommandI, Serializable

public class Substring extends NaryFunction
Extract substring of first argument: substring("abcdefg",2,4) -> "cd". Syntax substring(str,start,[end]). Second argument is starting index, third argument is optional, if not present return rest of string if present third argument is the ending index, exclusive. Note that the indices are zero-based.
  • If start is greater than the length of the string an EvaluationException is thrown.
  • If start is less than zero an EvaluationException is thrown.
  • If end is less than start an EvaluationException is thrown.
  • If end is greater than the length of the string an EvaluationException is thrown.
  • If str is not a string an EvaluationException is thrown.
  • If start is not a number representing an integer an EvaluationException is thrown.
  • If end is not a number representing an integer an EvaluationException is thrown.
See Also:
  • Constructor Details

    • Substring

      public Substring()
  • Method Details