I need to do two things with strings:
A. Remove the file extension
B. Remove the '-' from the dates.
An example of an uploaded string is:
ifrs_au-cor_2013-03-12.xsd
I can't just do a replace on '-' because the first part of the string contains a '-' that I don't want removed, only the date ones. However, the date will always be in YYYY-MM-DD format and it will be at the end with the extension.
Currently I only have the following code to remove the extension from the string:
String xsdfnameNoExtNoSlash = xsdfname;
int fileExtPos = xsdfname.LastIndexOf(".");
if (fileExtPos >= 0 )
xsdfnameNoExtNoSlash = xsdfname.Substring(0, fileExtPos);
Is there any way to do both of these operations in one go?