I have a file name 0154562A5BS16101[001]in which I would like to delete "[001]" just to leave 0154562A5BS16101.
I tried using regex:
var output = Regex.Replace(filename, @"[]", string.Empty);
But he throws:
System.ArgumentException: 'parsing '[]' - Unterminated [] set.'
It seems to me that this is quite easy for Regex masters, but I do not have much experience with Regex.
source
share