Utility function to check if we are inside a string.