Navigation
Synopsis Extract a substring from a string value.
Function
  1. str substring(str s, int begin)
  2. str substring(str s, int begin, int end)
Usage import String;
Description
  1. Yields substring of string s from index begin to the end of the string.
  2. Yields substring of string s from index begin to (but not including) index end.
Examples
rascal>import String;
ok
rascal>substring("abcdef", 2);
str: "cdef"
rascal>substring("abcdef", 2, 4);
str: "cd"
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.