1 of 1 people found this helpful
since the LastIndexOf always returns the start character of your search string. Thats one value, you need. Now you can use the Substring(Start, Length). That would look like this: InputString.Substring(1, InputString.LastIndexOf('XYZ'))
This will get you the string from start to the index of your search string. Maybe you have to play a little bit around with the LastIndexOf. Maybe you need to subtract 1 from it.
what a great help you have been.
You can also use regex to extract a portion of text in a realworld example as well though substring probably easier to get the miind around for sure, writing regex is like writing in “Klingon” to me at times!