public SMPLContainer visitStringExp(ASTSubstrExp st, SMPLEnvironment state) {
        
        SMPLContainer strContainer = st.getString().visit(this, state);
        SMPLContainer startContainer = st.getStart().visit(this, state);
        SMPLContainer endContainer = st.getEnd().visit(this, state);

        if (!"String".equals(strContainer.getType())) {
            System.out.println("TypeError: Expected \"String\", got \""+strContainer.getType()+"\".");
            return null;
        }

        if (!"Integer".equals(startContainer.getType())) {
            System.out.println("TypeError: Expected \"Integer\", got \""+startContainer.getType()+"\".");
            return null;
        }

        if (!"Integer".equals(endContainer.getType())) {
            System.out.println("TypeError: Expected \"Integer\", got \""+endContainer.getType()+"\".");
            return null;
        }

        String str = ((SMPLString) strContainer.getValue()).toString();
        int start = ((SMPLInt) startContainer.getValue()).getValue();
        int end = ((SMPLInt) endContainer.getValue()).getValue();

        try {
            return new SMPLContainer(new SMPLString(str.substring(start, end)));
        } catch (Exception e1) {
            System.out.println("Error while evaluating substring.\n" + e1.getMessage());
            return null;
        }
    }