Check which characters/substrings a given String starts or ends with.