In strings like this (I get strings from Directory.GetFiles()
)
string temp = "\\folder_name\\file_name.filetype.[somename@somedomain].wallet"
What is the best way to substring: file_name.filetype
I could do something like this:
const string source = ".[somename@somedomain].wallet";
temp.Substring(0, temp.IndexOf(source, StringComparison.Ordinal));
... but problem is that "mail" in string ".[xxxx@xxxx].wallet" is changing, in my words my string source should be something like this:
const string source = ".[*].wallet"; //so all strings that are in .[all_strings].wallet
Is there an easy way to do something like this (with asterisk "*"), or I will have to substring piece by piece and concatenate this new string?