-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add String Modifier to remove Remapped char collisions within origina…
…l stirng
- Loading branch information
1 parent
2b7aadd
commit 3a4610e
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using StringReloads.Engine; | ||
using StringReloads.Engine.Interface; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace StringReloads.StringModifier | ||
{ | ||
internal class AntiIlegalChar : IStringModifier | ||
{ | ||
public AntiIlegalChar(SRL Engine) | ||
{ | ||
Illegals = Engine.CharRemap.Values.ToArray(); | ||
} | ||
public string Name => "AntiIlegalChar"; | ||
|
||
public bool CanRestore => false; | ||
|
||
|
||
char[] Illegals; | ||
|
||
public string Apply(string String, string Original) | ||
{ | ||
foreach (var Char in Illegals) | ||
if (String.Contains(Char)) | ||
String = String.Replace(Char.ToString(), ""); | ||
|
||
return String; | ||
} | ||
|
||
public string Restore(string String) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |