OaklandJim
Well-known Member
- Joined
- Nov 29, 2018
- Messages
- 855
- Office Version
- 365
- Platform
- Windows
Am trying to help someone who posted to the list.
The logic for the function needed is a bit screwy but who can argue with someone posting about their need. I'll try to describe what I am after then give examples. I need to determine if a "partial" string is within another "full" string. Easy enough normally using InStr. BUT the twist is that if only a PART of the partial string is preset in the full string then the function should return false.
Example 1: Full string "stuff happy sad bloom". Partial string "happy sa" yields a False result because the partial string (as-is) is not present in the full string.
Example 2: Full string "stuff happy sad bloom". Partial string "happy sad" would yield True result because the entire partial string is present within the full string.
Example 3: Full string "stuff happy sad bloom". Partial string "stuff happy" would yield a True result because the entire partial string is included in the longer string.
Example 4: Full string "stuff happy sad bloom". Partial string "hap" would be a False result because the entire partial string (as is) is not present in the longer string.
The logic for the function needed is a bit screwy but who can argue with someone posting about their need. I'll try to describe what I am after then give examples. I need to determine if a "partial" string is within another "full" string. Easy enough normally using InStr. BUT the twist is that if only a PART of the partial string is preset in the full string then the function should return false.
Example 1: Full string "stuff happy sad bloom". Partial string "happy sa" yields a False result because the partial string (as-is) is not present in the full string.
Example 2: Full string "stuff happy sad bloom". Partial string "happy sad" would yield True result because the entire partial string is present within the full string.
Example 3: Full string "stuff happy sad bloom". Partial string "stuff happy" would yield a True result because the entire partial string is included in the longer string.
Example 4: Full string "stuff happy sad bloom". Partial string "hap" would be a False result because the entire partial string (as is) is not present in the longer string.