Functions startsWith() and endsWith() like in Python