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