I have a string, this string changes constantly.
I grab a part of my string which in code can be called let mySub = "xyz"
The original string is something that is changing over time, so dont worry how I get mySub
for this example lets say the string is let baseString = 123123xyz1234
How would I be able to grab a substring of everything before xyz
without it being hard coded so the position of xyz
can be different and the substring grabbing still works correctly?