ReplaceRestrictedChars
This commit is contained in:
parent
1388959ad2
commit
a4014c0b7f
@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!--package info-->
|
<!--package info-->
|
||||||
<PackageId>DTLib</PackageId>
|
<PackageId>DTLib</PackageId>
|
||||||
<Version>1.1.5</Version>
|
<Version>1.1.7</Version>
|
||||||
<Authors>Timerix</Authors>
|
<Authors>Timerix</Authors>
|
||||||
<Description>Library for all my C# projects</Description>
|
<Description>Library for all my C# projects</Description>
|
||||||
<RepositoryType>GIT</RepositoryType>
|
<RepositoryType>GIT</RepositoryType>
|
||||||
|
|||||||
@ -20,6 +20,8 @@ public readonly struct IOPath
|
|||||||
|
|
||||||
public IOPath(string path, bool separatorsFixed=false)
|
public IOPath(string path, bool separatorsFixed=false)
|
||||||
{
|
{
|
||||||
|
if (path.IsNullOrEmpty())
|
||||||
|
throw new Exception("path is null or empty");
|
||||||
Str = separatorsFixed ? path : FixSeparators(path.ToCharArray());
|
Str = separatorsFixed ? path : FixSeparators(path.ToCharArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,13 +32,14 @@ public static class Path
|
|||||||
case ':': case ';':
|
case ':': case ';':
|
||||||
r[i] = '-';
|
r[i] = '-';
|
||||||
break;
|
break;
|
||||||
case '\n': case '\r': case ' ':
|
case '\n': case '\r': case '\'':
|
||||||
case '#': case '%': case '&':
|
case '"': case '`':
|
||||||
case '{': case '}': case '<':
|
break;
|
||||||
case '>': case '*': case '?':
|
case ' ': case '&': case '{': case '}':
|
||||||
case '$': case '!': case '\'':
|
case '<': case '>': case '*': case '?':
|
||||||
case '"': case '@': case '+':
|
case '$': case '%': case '@': case '|':
|
||||||
case '`': case '|': case '=':
|
// case '!':
|
||||||
|
// case '#':
|
||||||
r[i] = '_';
|
r[i] = '_';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user