mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: Additional validation
This commit is contained in:
parent
2fab5d6fd4
commit
1a931e6ffb
1 changed files with 6 additions and 0 deletions
|
|
@ -165,6 +165,9 @@ namespace ICD.Common.Utils
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static byte[] ToBytes(string input)
|
public static byte[] ToBytes(string input)
|
||||||
{
|
{
|
||||||
|
if (input == null)
|
||||||
|
throw new ArgumentNullException("input");
|
||||||
|
|
||||||
return Encoding.GetEncoding(28591).GetBytes(input);
|
return Encoding.GetEncoding(28591).GetBytes(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -315,6 +318,9 @@ namespace ICD.Common.Utils
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string NiceName(string name)
|
public static string NiceName(string name)
|
||||||
{
|
{
|
||||||
|
if (name == null)
|
||||||
|
throw new ArgumentNullException("name");
|
||||||
|
|
||||||
Regex regex = new Regex(@"
|
Regex regex = new Regex(@"
|
||||||
(?<=[A-Z])(?=[A-Z][a-z]) |
|
(?<=[A-Z])(?=[A-Z][a-z]) |
|
||||||
(?<=[^A-Z])(?=[A-Z]) |
|
(?<=[^A-Z])(?=[A-Z]) |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue