XG.Model.Domain.Helper.ShrinkFileName C# (CSharp) Method

ShrinkFileName() public static method

Returns the file name ripped of the following chars ()[]{}-_.
public static ShrinkFileName ( string aName, System.Int64 aSize ) : string
aName string
aSize System.Int64
return string
        public static string ShrinkFileName(string aName, Int64 aSize)
        {
            return aName != null ? Regex.Replace(aName.ToLower(), "[^a-z0-9]", "") + "." + aSize : "";
        }

Usage Example

Example #1
0
 public File(string aName, Int64 aSize)
 {
     base.Name = Helper.RemoveBadCharsFromFileName(aName);
     _size     = aSize;
     _tmpName  = Helper.ShrinkFileName(aName, aSize);
 }