C# Class Evbpc.Framework.Utilities.Extensions.StringExtensions

Provides extensions to convert certain objects to certain other objects.
Show file Open project: EBrown8534/Framework

Public Methods

Method Description
BuildQueryString ( string>.Dictionary values ) : string
FromBase64String ( this input, Base64FormattingOptions options = Base64FormattingOptions.RequirePaddingCharacter ) : byte[]

Converts an RFC4648 (https://tools.ietf.org/html/rfc4648) Base64 string to a byte-array.

GetCharacterType ( this c ) : CharacterType
HexToByteArray ( this hex ) : byte[]

Converts a hexadecimal string to a byte array.

InsertOnCharacter ( this source, CharacterType type, string insert ) : string

Inserts a string into another string before each occurrence of the specified CharacterType.

In the case of the first character of source matching the specified CharacterType, the insert will not be inserted.

StringArrayToHexArray ( this input ) : string[]

Converts a string array to a hexadecimal array.

ToBase32String ( this input, Base32FormattingOptions options = Base32FormattingOptions.RequirePaddingCharacter ) : string

Converts a byte-array to an RFC4648 (https://tools.ietf.org/html/rfc4648) Base32 string.

ToBase64String ( this input, Base64FormattingOptions options = Base64FormattingOptions.RequirePaddingCharacter, uint charactersPerLine ) : string

Converts a byte-array to an RFC4648 (https://tools.ietf.org/html/rfc4648) Base64 string.

ToHexString ( this input ) : string

Converts a byte array to a hexadecimal string.

ToPascalCase ( this s ) : string

Converts a string of dash-separated, or underscore-separated words to a PascalCase string.

Method Details

BuildQueryString() public static method

public static BuildQueryString ( string>.Dictionary values ) : string
values string>.Dictionary
return string

FromBase64String() public static method

Converts an RFC4648 (https://tools.ietf.org/html/rfc4648) Base64 string to a byte-array.
public static FromBase64String ( this input, Base64FormattingOptions options = Base64FormattingOptions.RequirePaddingCharacter ) : byte[]
input this The input string.
options Base64FormattingOptions Any of enumeration values.
return byte[]

GetCharacterType() public static method

public static GetCharacterType ( this c ) : CharacterType
c this
return CharacterType

HexToByteArray() public static method

Converts a hexadecimal string to a byte array.
public static HexToByteArray ( this hex ) : byte[]
hex this The hexadecimal string to convert.
return byte[]

InsertOnCharacter() public static method

Inserts a string into another string before each occurrence of the specified CharacterType.
In the case of the first character of source matching the specified CharacterType, the insert will not be inserted.
public static InsertOnCharacter ( this source, CharacterType type, string insert ) : string
source this The string to insert into.
type CharacterType The to insert before.
insert string The string to insert.
return string

StringArrayToHexArray() public static method

Converts a string array to a hexadecimal array.
public static StringArrayToHexArray ( this input ) : string[]
input this The array to convert.
return string[]

ToBase32String() public static method

Converts a byte-array to an RFC4648 (https://tools.ietf.org/html/rfc4648) Base32 string.
public static ToBase32String ( this input, Base32FormattingOptions options = Base32FormattingOptions.RequirePaddingCharacter ) : string
input this The input byte-array.
options Base32FormattingOptions Any of enumeration values.
return string

ToBase64String() public static method

Converts a byte-array to an RFC4648 (https://tools.ietf.org/html/rfc4648) Base64 string.
public static ToBase64String ( this input, Base64FormattingOptions options = Base64FormattingOptions.RequirePaddingCharacter, uint charactersPerLine ) : string
input this The input byte-array.
options Base64FormattingOptions Any of enumeration values.
charactersPerLine uint If this is a non-zero uinteger, than the number of characters per line will be equivalent to this value.
return string

ToHexString() public static method

Converts a byte array to a hexadecimal string.
public static ToHexString ( this input ) : string
input this The byte array to convert.
return string

ToPascalCase() public static method

Converts a string of dash-separated, or underscore-separated words to a PascalCase string.
public static ToPascalCase ( this s ) : string
s this The string to convert.
return string