AddJsonArrayAttributesForXPath
public static void AddJsonArrayAttributesForXPath(string xpath, ref SimplisityInfo sInfo)
Example
AddJsonArrayAttributesForXPath(xpath, sInfo)
AddJsonNetRootAttribute
public static void AddJsonNetRootAttribute(ref SimplisityInfo sInfo)
Example
AddJsonNetRootAttribute(sInfo)
AlphaNumeric
Description: strips out all nonalphanumeric characters.
Signaturepublic static string AlphaNumeric(string strIn)
Example
AlphaNumeric(strIn)
Base64Decode
public static string Base64Decode(string base64EncodedData)
Example
Base64Decode(base64EncodedData)
Base64Encode
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.
Signaturepublic static string CleanInput(string strIn, string regexpr = "")
Example
CleanInput(strIn, regexpr)
CopyAll
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
public static void CopyDirectory(string sourceDir, string destinationDir, bool recursive)
Example
CopyDirectory(sourceDir, destinationDir, recursive)
CreateFolder
public static void CreateFolder(string folderMapPath)
Example
CreateFolder(folderMapPath)
DeCode
public static string DeCode(string codedval)
Example
DeCode(codedval)
DecodeCSV
public static string DecodeCSV(string inputData)
Example
DecodeCSV(inputData)
Decrypt
public static string Decrypt(string strKey, string strData)
Example
Decrypt(strKey, strData)
DeleteFolder
public static void DeleteFolder(string folderMapPath, bool recursive = false)
Example
DeleteFolder(folderMapPath, recursive)
DeleteSysFile
public static void DeleteSysFile(string filePathName)
Example
DeleteSysFile(filePathName)
EnCode
public static string EnCode(string value)
Example
EnCode(value)
Encrypt
public static string Encrypt(string strKey, string strData)
Example
Encrypt(strKey, strData)
EscapeJsonString
public static string EscapeJsonString(string value)
Example
EscapeJsonString(value)
FormatAsMailTo
public static string FormatAsMailTo(string email, string subject = "", string visibleText = "")
Example
FormatAsMailTo(email, subject, visibleText)
FormatDateToString
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.
Signaturepublic static string FormatDisableScripting(string strInput, bool filterlinks = true)
Example
FormatDisableScripting(strInput, filterlinks)
FormatToDisplay
public static string FormatToDisplay(string inpData, string cultureCode, TypeCode dataTyp, string formatCode = "")
Example
FormatToDisplay(inpData, cultureCode, dataTyp, formatCode)
FormatToSave
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
public static string GetGuidKey()
Example
GetGuidKey()
GetMd5Hash
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()
Signaturepublic 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.
Signaturepublic static string GetUniqueString(int randomsize = 8)
Example
GetUniqueString(randomsize)
HtmlToPlainText
public static string HtmlToPlainText(string html)
Example
HtmlToPlainText(html)
IsAbsoluteUrl
public static bool IsAbsoluteUrl(string url)
Example
IsAbsoluteUrl(url)
IsCultureInfo
public static bool IsCultureInfo(string cultureCode)
Example
IsCultureInfo(cultureCode)
IsDate
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.
Signaturepublic static bool IsDateInvariantCulture(object expression)
Example
IsDateInvariantCulture(expression)
IsEmail
Description: IsEmail function checks for a valid email format
Signaturepublic 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.
Signaturepublic static bool IsNumeric(object expression, string cultureCode = "")
Example
IsNumeric(expression, cultureCode)
IsUriValid
public static bool IsUriValid(string uri, UriKind uriKind = UriKind.RelativeOrAbsolute, bool checkexists = false)
Example
IsUriValid(uri, uriKind, checkexists)
IsValidEmail
public bool IsValidEmail(string strIn)
Example
@IsValidEmail(strIn)
Numeric
Description: strips out all nonnumeric characters.
Signaturepublic static string Numeric(string strIn)
Example
Numeric(strIn)
ObjectToByteArray
public static byte[] ObjectToByteArray(Object obj)
Example
ObjectToByteArray(obj)
RemapInternationalCharToAscii
public static string RemapInternationalCharToAscii(char c)
Example
RemapInternationalCharToAscii(c)
RemoveDiacritics
public static string RemoveDiacritics(string text)
Example
RemoveDiacritics(text)
ReplaceFileExt
public static string ReplaceFileExt(string fileName, string newExt)
Example
ReplaceFileExt(fileName, newExt)
ReplaceFirstOccurrence
public static string ReplaceFirstOccurrence(string source, string find, string replace)
Example
ReplaceFirstOccurrence(source, find, replace)
ReplaceLastOccurrence
public static string ReplaceLastOccurrence(string source, string find, string replace)
Example
ReplaceLastOccurrence(source, find, replace)
SafeSubstring
public static string SafeSubstring(string input, int maxLength)
Example
SafeSubstring(input, maxLength)
SanitizeFileName
public static string SanitizeFileName(string fileName)
Example
SanitizeFileName(fileName)
StripAccents
Description: Strip accents from string.
Signaturepublic static string StripAccents(string s)
Example
StripAccents(s)
StrToByteArray
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)
Signaturepublic static string UrlFriendly(string title)
Example
UrlFriendly(title)