mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
feat: Additional validation
This commit is contained in:
@@ -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]) |
|
||||||
|
|||||||
Reference in New Issue
Block a user