98
1
using System;
2
3
public static class Program
4
{
5
const string ShareExtUNCFullPrefix = @"\\?\UNC\";
6
const string ShareExtPrefix = @"\\?\";
7
const string SharePrefix = @"\\";
8
const string DIR = @"\";
9
const char cDIR = '\\';
10
const string DIRDOUBLE = @"\\";
11
const string COLONDIR = @":\";
12
const string COLON = @":";
13
const char cCOLON = ':';
14
const string DIRSPACE = @"\ ";
15
const string SPACEDIR = @" \";
16
const string SPACE = @" ";
17
18
public static int IndexOfOccurence(this string s, char match, int occurence)
19
{
20
int i = 1;
21
int index = -1;
22
23
while (i <= occurence && (index = s.IndexOf(match, index + 1)) != -1)
24
{
Cached Result
\\2001:4860:4860::8888\share
\\8.8.8.8\share
\\host\share
\\host\share
\\h\s
\\h\s
\\share\tail, 1 failed case - UNC is Server Name
\\8.8.8.8\share
\\host\share
\\host\share
\\h\s
\\h\s
\\share\tail, 1 failed case - UNC is Server Name