SpringCard LibCs for .NET  18.10.10
A set of utilities to simplify the development of .NET application
SpringCard.LibCs.StrUtils Class Reference

String manipulation utilities. More...

Static Public Member Functions

static int CountTokens (string source, char searched)
 Count the number of occurrences of a char in a string.
 
static byte [] Base64Decode (string content)
 Translate a base64-encoded string into its actual value.
 
static byte [] Base64UrlDecode (string message)
 Translate a base64url-encoded string into its actual value.
 
static string Base64UrlDecodeString (string message, Encoding encoding)
 Translate a base64url-encoded string into its actual value - expect the value is a string itself.
 
static string Base64UrlDecodeString (string message)
 Translate a base64url-encoded string into its actual value - expect the value is a string itself.
 
static string Base64Encode (byte[] content, int lineLength=0)
 Translate an array of bytes into base64.
 
static string Base64UrlEncode (byte[] content)
 Translate an array of bytes into base64url.
 
static string Base64UrlEncode (string content, Encoding encoding)
 Translate a string into base64url.
 
static string Base64UrlEncode (string content)
 Translate a string into base64url.
 
static byte [] ToBytes (string input, Encoding encoding, bool includeTerminator=false)
 Convert a string into an array of bytes. The '\0' terminator may be included if requested.
 
static byte [] ToBytes (string input, bool includeTerminator=false)
 Convert a string into an array of bytes. The '\0' terminator may be included if requested.
 
static string ToStr (byte[] buffer, Encoding encoding)
 Convert an array of bytes into a string.
 
static string ToStr (byte[] buffer)
 Convert an array of bytes into a string.
 
static string ToStr (byte[] buffer, int offset, Encoding encoding)
 Convert an array of bytes into a string.
 
static string ToStr (byte[] buffer, int offset)
 Convert an array of bytes into a string.
 
static string ToStr (byte[] buffer, int offset, int length, Encoding encoding)
 Convert an array of bytes into a string.
 
static string ToStr (byte[] buffer, int offset, int length)
 Convert an array of bytes into a string.
 
static byte [] ToBytes_UTF8 (string input, bool includeTerminator=false)
 Convert a string into an array of bytes, encoded in UTF8. The '\0' terminator may be included if requested.
 
static string ToStr_UTF8 (byte[] buffer)
 Convert an array of bytes, supposingly holding an UTF8 string, into a string.
 
static string ToStr_UTF8 (byte[] buffer, int offset)
 Convert an array of bytes, supposingly holding an UTF8 string, into a string.
 
static string ToStr_UTF8 (byte[] buffer, int offset, int length)
 Convert an array of bytes, supposingly holding an UTF8 string, into a string.
 
static byte [] ToBytes_ASCII (string input, bool includeTerminator=false)
 Convert a string into an array of bytes, encoded in ASCII. The '\0' terminator may be included if requested.
 
static string ToStr_ASCII (byte[] buffer)
 Convert an array of bytes, supposingly holding an ASCII string, into a string.
 
static string ToStr_ASCII (byte[] buffer, int offset)
 Convert an array of bytes, supposingly holding an ASCII string, into a string.
 
static string ToStr_ASCII (byte[] buffer, int offset, int length)
 Convert an array of bytes, supposingly holding an ASCII string, into a string.
 
static string ToStr_ASCII_nice (byte[] buffer, bool stopOnZero=true)
 Convert an array of bytes, supposingly holding an ASCII string, into a string. Non ASCII chars are replaced by '.'.
 
static bool IsValidInteger (string value)
 Return true if the string contains an integer.
 
static bool IsValidBoolean (string value)
 Return true if the string contains a boolean ("true", "false", "yes", "no" or an integer)
 
static bool ReadBoolean (string value)
 Read a boolean value from a string: return true for "true", "yes" or a non-zero integer, false otherwise.
 
static bool ReadBoolean (string value, out bool valid)
 Read a boolean value from a string; the valid out parameter takes the return of IsValidBoolean()
 

Detailed Description

String manipulation utilities.


The documentation for this class was generated from the following file: