I have strings that look something like this:
'T1 Test 2 Sku Red Widget at 10.0'
To extract 'Red Widget' I have been using the code below:
s = 'T1 Test 2 Sku Red Widget at 10.0'
t = s[s.find('Sku ')+4 : s.find(' at')]
print(t)
This worked fine but now the string inputs have changed so that they may contain either 'Sku' (the starting sub-string) or 'Id'.
This code obviously won't work when 'Id' is used so how can I adapt it to capture both scenarios?