How to make a replace in a string irrespective of string length?

with the same pattern from @Yoichi you can extract the middle string with Regex.Match

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=^.{6}).*(?=.{4}$)").Value

For stepping into the topic of Regex also have a look here:
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

1 Like