I was looking for this for 2 hours and after posting I found a solution by chance after 5 min.
I will leave this with my solution if someone have the same problem later.
this page show how it is done in python:
https://www.freecodecamp.org/news/how-to-substring-a-string-in-python/
now I started trying to find any function in UIflow that could replicate this and...
"bytearray in list xxx get sub-list from # to #" actually writes this code!