Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask.