Use startsWith and endsWith.