Try using substring like this:
substring
const str="12345678"; const sub = str.substring(2, str.length-1); // "34567"