Bloomberg Interview Question

Write a code to determine if a pattern exists in a string.