private void trimPreviousName() { this.OriginalFileName = (this.GridViewRowSelected.FindControl("ltlFileItem") as Literal).Text; this.Prefix = OriginalFileName.Substring(0, 3); this.NewFileName = OriginalFileName.Substring(0, OriginalFileName.Length - 4); int ingnoreMe = 0; if (int.TryParse(Prefix.Substring(0, 2), out ingnoreMe)) { this.NewFileName = NewFileName.Substring(3); } }
private void StripExtensionAndCleanFileName() { FileNameExtension = OriginalFileName.Substring(OriginalFileName.LastIndexOf('.')); _fileNameWithoutExtensionAndClean = Regex.Replace(OriginalFileName.Replace(FileNameExtension, String.Empty), @"[\._-]+", " "); }