anyways, I need help on searching for a guide that helps with decoding a text object with a certain format. My brain’s not braining, I cant think of the search terms. Help is 100000% appreciated. thx
-costco
also I hate it when people click in to add a view but do absolutely nothing
Here I’ll just
So lets say I have some text
it looks like this: |item1|item2|item3|item4|
the separator character is |
In theory, with the following python code you can “grab” item2 like it’s a list item:
def substring(txt, sep, sep_idx) -> int:
sep_amt = 1
i = 0
while i+1<len(txt):
char = txt[i]
if char == sep:
if sep_amt == sep_idx:
return i
else:
sep_amt +=1
i += 1
but I can’t find the block to grab like the second |, only the first one