Get File System Resource Without Protocol - CSharp System.Xml

CSharp examples for System.Xml:XML File

Description

Get File System Resource Without Protocol

Demo Code


using System.Xml.Linq;
using System.Linq;
using System.Reflection;
using System.Security.Permissions;
using System.IO;//from w  w w. j a v  a  2  s .  co  m
using System.Collections;
using System.Xml;
using System.Text;
using System.Collections.Generic;
using System;

public class Main{
        public static string GetFileSystemResourceWithoutProtocol(string filePath)
        {
            int index = filePath.IndexOf("://");
            if (index == -1)
            {
                return filePath;
            }
            if (filePath.Length > (index + "://".Length))
            {
                while (filePath[++index] == '/')
                {
                }
            }
            return filePath.Substring(index);
        }
}

Related Tutorials