Table of Contents
AddJsonArrayAttributesForXPath
Signature
public static void AddJsonArrayAttributesForXPath(string xpath, ref SimplisityInfo sInfo)
Example
AddJsonArrayAttributesForXPath(xpath, sInfo)
AddJsonNetRootAttribute
Signature
public static void AddJsonNetRootAttribute(ref SimplisityInfo sInfo)
Example
AddJsonNetRootAttribute(sInfo)
AlphaNumeric

Description: strips out all nonalphanumeric characters.

Signature
public static string AlphaNumeric(string strIn)
Example
AlphaNumeric(strIn)
Base64Decode
Signature
public static string Base64Decode(string base64EncodedData)
Example
Base64Decode(base64EncodedData)
Base64Encode
Signature
public static string Base64Encode(string plainText)
Example
Base64Encode(plainText)
CleanInput

Description: CleanInput strips out all nonalphanumeric characters except periods (.), at symbols (@), and hyphens (-), and returns the remaining string. However, you can modify the regular expression pattern so that it strips out any characters that should not be included in an input string.

Signature
public static string CleanInput(string strIn, string regexpr = "")
Example
CleanInput(strIn, regexpr)
CopyAll
Signature
public static void CopyAll(string source, string target)
Example
CopyAll(source, target)
Signature
public static void CopyAll(DirectoryInfo source, DirectoryInfo target)
Example
CopyAll(source, target)
CopyDirectory
Signature
public static void CopyDirectory(string sourceDir, string destinationDir, bool recursive)
Example
CopyDirectory(sourceDir, destinationDir, recursive)
CreateFolder
Signature
public static void CreateFolder(string folderMapPath)
Example
CreateFolder(folderMapPath)
DeCode
Signature
public static string DeCode(string codedval)
Example
DeCode(codedval)
DecodeCSV
Signature
public static string DecodeCSV(string inputData)
Example
DecodeCSV(inputData)
Decrypt
Signature
public static string Decrypt(string strKey, string strData)
Example
Decrypt(strKey, strData)
DeleteFolder
Signature
public static void DeleteFolder(string folderMapPath, bool recursive = false)
Example
DeleteFolder(folderMapPath, recursive)
DeleteSysFile
Signature
public static void DeleteSysFile(string filePathName)
Example
DeleteSysFile(filePathName)
EnCode
Signature
public static string EnCode(string value)
Example
EnCode(value)
Encrypt
Signature
public static string Encrypt(string strKey, string strData)
Example
Encrypt(strKey, strData)
EscapeJsonString
Signature
public static string EscapeJsonString(string value)
Example
EscapeJsonString(value)
FormatAsMailTo
Signature
public static string FormatAsMailTo(string email, string subject = "", string visibleText = "")
Example
FormatAsMailTo(email, subject, visibleText)
FormatDateToString
Signature
public static string FormatDateToString(DateTime dateTime, string cultureCode)
Example
FormatDateToString(dateTime, cultureCode)
FormatDisableScripting

Description: This function uses Regex search strings to remove HTML tags which are targeted in Cross-site scripting (XSS) attacks. This function will evolve to provide more robust checking as additional holes are found.

Signature
public static string FormatDisableScripting(string strInput, bool filterlinks = true)
Example
FormatDisableScripting(strInput, filterlinks)
FormatToDisplay
Signature
public static string FormatToDisplay(string inpData, string cultureCode, TypeCode dataTyp, string formatCode = "")
Example
FormatToDisplay(inpData, cultureCode, dataTyp, formatCode)
FormatToSave
Signature
public static string FormatToSave(string inpData)
Example
FormatToSave(inpData)
Signature
public static string FormatToSave(string inpData, TypeCode dataTyp)
Example
FormatToSave(inpData, dataTyp)
Signature
public static string FormatToSave(string inpData, TypeCode dataTyp, string editlang)
Example
FormatToSave(inpData, dataTyp, editlang)
GetGuidKey
Signature
public static string GetGuidKey()
Example
GetGuidKey()
GetMd5Hash
Signature
public static string GetMd5Hash(string input)
Example
GetMd5Hash(input)
Signature
public static string GetMd5Hash(string input, bool uppercase)
Example
GetMd5Hash(input, uppercase)
GetRandomKey

Description: Get a random string. However the code MAY NOT be unique. Do not use this method if you MUST have a unique string, try GetUniqueString()

Signature
public static string GetRandomKey(int maxSize = 0, bool numericOnly = false)
Example
GetRandomKey(maxSize, numericOnly)
GetUniqueString

Description: Get unique string based on ticks and a random numer. The random number is to try and stop clashes when processing on the same tick. This method has a VERY HIGH chance of being unique.

Signature
public static string GetUniqueString(int randomsize = 8)
Example
GetUniqueString(randomsize)
HtmlToPlainText
Signature
public static string HtmlToPlainText(string html)
Example
HtmlToPlainText(html)
IsAbsoluteUrl
Signature
public static bool IsAbsoluteUrl(string url)
Example
IsAbsoluteUrl(url)
IsCultureInfo
Signature
public static bool IsCultureInfo(string cultureCode)
Example
IsCultureInfo(cultureCode)
IsDate
Signature
public static bool IsDate(object expression, string cultureCode)
Example
IsDate(expression, cultureCode)
IsDateInvariantCulture

Description: Test date in these formats nby default: { "yyyy-MM-dd", "yyyy/MM/dd", "MM-dd-yyyy", "MM/dd/yyyy", "dd/MM/yyyy", "dd-MM-yyyy" } Use IsDate function if you know the culturecode.

Signature
public static bool IsDateInvariantCulture(object expression)
Example
IsDateInvariantCulture(expression)
IsEmail

Description: IsEmail function checks for a valid email format

Signature
public static bool IsEmail(string emailaddress)
Example
IsEmail(emailaddress)
IsNumeric

Description: IsNumeric function check if a given value is numeric, based on the culture code passed. If no culture code is passed then a test on InvariantCulture is done.

Signature
public static bool IsNumeric(object expression, string cultureCode = "")
Example
IsNumeric(expression, cultureCode)
IsUriValid
Signature
public static bool IsUriValid(string uri, UriKind uriKind  = UriKind.RelativeOrAbsolute, bool checkexists = false)
Example
IsUriValid(uri, uriKind, checkexists)
IsValidEmail
Signature
public bool IsValidEmail(string strIn)
Example
@IsValidEmail(strIn)
Numeric

Description: strips out all nonnumeric characters.

Signature
public static string Numeric(string strIn)
Example
Numeric(strIn)
ObjectToByteArray
Signature
public static byte[] ObjectToByteArray(Object obj)
Example
ObjectToByteArray(obj)
RemapInternationalCharToAscii
Signature
public static string RemapInternationalCharToAscii(char c)
Example
RemapInternationalCharToAscii(c)
RemoveDiacritics
Signature
public static string RemoveDiacritics(string text)
Example
RemoveDiacritics(text)
ReplaceFileExt
Signature
public static string ReplaceFileExt(string fileName, string newExt)
Example
ReplaceFileExt(fileName, newExt)
ReplaceFirstOccurrence
Signature
public static string ReplaceFirstOccurrence(string source, string find, string replace)
Example
ReplaceFirstOccurrence(source, find, replace)
ReplaceLastOccurrence
Signature
public static string ReplaceLastOccurrence(string source, string find, string replace)
Example
ReplaceLastOccurrence(source, find, replace)
SafeSubstring
Signature
public static string SafeSubstring(string input, int maxLength)
Example
SafeSubstring(input, maxLength)
SanitizeFileName
Signature
public static string SanitizeFileName(string fileName)
Example
SanitizeFileName(fileName)
StripAccents

Description: Strip accents from string.

Signature
public static string StripAccents(string s)
Example
StripAccents(s)
StrToByteArray
Signature
public static byte[] StrToByteArray(string str)
Example
StrToByteArray(str)
UrlFriendly

Description: Produces optional, URL-friendly version of a title, "like-this-one". hand-tuned for speed, reflects performance refactoring contributed by John Gietzen (user otac0n)

Signature
public static string UrlFriendly(string title)
Example
UrlFriendly(title)