Hi everyone, I need your help with a small problem that I can't find a solution even after finishing the whole course. As an assignment, I need to write a script that would check multiple objects which contain only one value each like an SKU similar to this: [color id, size, quantity] (note the comma is count along as a whole string, not a separator in coding.
I need to check if the particular size has the required quantity, for example:
Object 1 has a value of [0001,S,2 | 0001,M,8 | 0001,L,8]
- Check if small size must always have 2 items:
if Object 1 has this "S,2" in its value => return true. Otherwise return false for any other scenarios.
Then continue to check the medium size, and so on. The main problem is I don't know how to search a specific letter like "S,2" inside of an object's value. Please help me to suggest a solution that can either break the value into sub strings for Small, Medium and Large size OR like a function that search a specific letter similar to a Left, Mid, Right functions in Excel.