CSKernelFile.cFile.getFileExt C# (CSharp) Method

getFileExt() public static method

public static getFileExt ( string fullFileName ) : string
fullFileName string
return string
        public static string getFileExt(string fullFileName)
        {
            string path = "";
            string fileName = "";
            int sepPos = 0;
            string sep = "";

            getPathAndFileName(fullFileName, out path, out fileName);
            sepPos = fileName.Length;

            if (sepPos == 0)
            {
                return "";
            }
            else
            {
                sepPos -= 1;
                sep = fileName.Substring(sepPos, 1);
                while (sep != ".")
                {
                    sepPos--;
                    if (sepPos < 0) break;
                    sep = fileName.Substring(sepPos, 1);
                }
                if (sepPos < 0)
                {
                    return "";
                }
                else
                {
                    return fileName.Substring(sepPos + 1);
                }
            }
        }