C# Class org.GraphDefined.Vanaheimr.Illias.StringExtensions

Extensions to the String class.
Mostrar archivo Open project: Vanaheimr/Illias

Public Methods

Method Description
AggregateIndentedLines ( this Text ) : IEnumerable

Converts the given enumeration of strings into an enumeration of key-value-pairs.

DoubleSplit ( this Text, Char FirstSeparator, Char SecondSeparator ) : String>.Dictionary
DoubleSplitInto ( this Text, Char FirstSeparator, Char SecondSeparator, String>.Dictionary Dictionary ) : String>.Dictionary
EscapeForXMLandHTML ( this myString ) : String
FailIfNotNullOrEmpty ( this GivenString, String ExceptionMessage = null, [ ParameterName = "" ) : void

Throws an ArgumentNullException whenever the given string is not null or empty.

FailIfNullOrEmpty ( this GivenString, String ExceptionMessage = null, [ ParameterName = "" ) : void

Throws an ArgumentNullException whenever the given string is null or empty.

FromBase64 ( this myBase64String ) : String
IfNotNullOrEmpty ( this GivenString, String>.Func Mapper ) : String

Mappes the given string if it is not null or empty.

IsNotNullAndContains ( this String, String Substring ) : System.Boolean

Returns a value indicating whether the specified Substring occurs within the given string.

IsNotNullOrEmpty ( this GivenString ) : System.Boolean

Indicates whether the given string is not null or empty.

IsNotNullOrEmpty ( this GivenString, Action Delegate, [ ParameterName = "" ) : void

Call the given delegate whether the specified string is not null or empty.

IsNullOrEmpty ( this GivenString ) : System.Boolean

Indicates whether the given string is null or empty.

IsNullOrEmpty ( this GivenString, Action Delegate, [ ParameterName = "" ) : void

Call the given delegate whether the specified string is null or empty.

LastIndexOfOrMax ( this Text, String Pattern ) : Int32
RemoveAllAfter ( this String, String Substring ) : String

Removes everything from the string after the given substring.

RemoveAllBefore ( this String, String Substring ) : String

Removes everything from the string before the given substring.

RemoveLastSlash ( this Text ) : String
RemoveQuotes ( this String ) : String

Removes leading and/or tailing (double) quotes.

ReplacePrefix ( this Text, String Prefix, String Replacement ) : String
Reverse ( this String ) : String

Reverse the given string.

SubTokens ( this Text, UInt16 Length ) : IEnumerable
SubstringMax ( this Text, Int32 Length ) : String

Return a substring of the given maximum length.

ToBase64 ( this myString ) : String
ToKeyValuePairs ( this Text ) : String>>.IEnumerable

Converts the given enumeration of strings into an enumeration of key-value-pairs.

ToUTF8Bytes ( this Text ) : Byte[]
ToUTF8String ( this ArrayOfBytes, Int32 NumberOfBytes = -1, System.Boolean ThrowException = true ) : String

Method Details

AggregateIndentedLines() public static method

Converts the given enumeration of strings into an enumeration of key-value-pairs.
public static AggregateIndentedLines ( this Text ) : IEnumerable
Text this An enumeration of strings.
return IEnumerable

DoubleSplit() public static method

public static DoubleSplit ( this Text, Char FirstSeparator, Char SecondSeparator ) : String>.Dictionary
Text this
FirstSeparator Char
SecondSeparator Char
return String>.Dictionary

DoubleSplitInto() public static method

public static DoubleSplitInto ( this Text, Char FirstSeparator, Char SecondSeparator, String>.Dictionary Dictionary ) : String>.Dictionary
Text this
FirstSeparator Char
SecondSeparator Char
Dictionary String>.Dictionary
return String>.Dictionary

EscapeForXMLandHTML() public static method

public static EscapeForXMLandHTML ( this myString ) : String
myString this
return String

FailIfNotNullOrEmpty() public static method

Throws an ArgumentNullException whenever the given string is not null or empty.
public static FailIfNotNullOrEmpty ( this GivenString, String ExceptionMessage = null, [ ParameterName = "" ) : void
GivenString this The string.
ExceptionMessage String An optional message to be added to the exception.
ParameterName [ The parameter name of the given string (CallerMemberName).
return void

FailIfNullOrEmpty() public static method

Throws an ArgumentNullException whenever the given string is null or empty.
public static FailIfNullOrEmpty ( this GivenString, String ExceptionMessage = null, [ ParameterName = "" ) : void
GivenString this The string.
ExceptionMessage String An optional message to be added to the exception.
ParameterName [ The parameter name of the given string (CallerMemberName).
return void

FromBase64() public static method

public static FromBase64 ( this myBase64String ) : String
myBase64String this
return String

IfNotNullOrEmpty() public static method

Mappes the given string if it is not null or empty.
public static IfNotNullOrEmpty ( this GivenString, String>.Func Mapper ) : String
GivenString this The string.
Mapper String>.Func A string mapper delegate.
return String

IsNotNullAndContains() public static method

Returns a value indicating whether the specified Substring occurs within the given string.
public static IsNotNullAndContains ( this String, String Substring ) : System.Boolean
String this A string.
Substring String A substring to search for.
return System.Boolean

IsNotNullOrEmpty() public static method

Indicates whether the given string is not null or empty.
public static IsNotNullOrEmpty ( this GivenString ) : System.Boolean
GivenString this The string.
return System.Boolean

IsNotNullOrEmpty() public static method

Call the given delegate whether the specified string is not null or empty.
public static IsNotNullOrEmpty ( this GivenString, Action Delegate, [ ParameterName = "" ) : void
GivenString this The string.
Delegate Action A delegate to call whenever the given string is null or empty.
ParameterName [ The parameter name of the given string (CallerMemberName).
return void

IsNullOrEmpty() public static method

Indicates whether the given string is null or empty.
public static IsNullOrEmpty ( this GivenString ) : System.Boolean
GivenString this The string.
return System.Boolean

IsNullOrEmpty() public static method

Call the given delegate whether the specified string is null or empty.
public static IsNullOrEmpty ( this GivenString, Action Delegate, [ ParameterName = "" ) : void
GivenString this The string.
Delegate Action A delegate to call whenever the given string is null or empty.
ParameterName [ The parameter name of the given string (CallerMemberName).
return void

LastIndexOfOrMax() public static method

public static LastIndexOfOrMax ( this Text, String Pattern ) : Int32
Text this
Pattern String
return System.Int32

RemoveAllAfter() public static method

Removes everything from the string after the given substring.
public static RemoveAllAfter ( this String, String Substring ) : String
String this A string.
Substring String A substring.
return String

RemoveAllBefore() public static method

Removes everything from the string before the given substring.
public static RemoveAllBefore ( this String, String Substring ) : String
String this A string.
Substring String A substring.
return String

RemoveLastSlash() public static method

public static RemoveLastSlash ( this Text ) : String
Text this
return String

RemoveQuotes() public static method

Removes leading and/or tailing (double) quotes.
public static RemoveQuotes ( this String ) : String
String this The string to check.
return String

ReplacePrefix() public static method

public static ReplacePrefix ( this Text, String Prefix, String Replacement ) : String
Text this
Prefix String
Replacement String
return String

Reverse() public static method

Reverse the given string.
public static Reverse ( this String ) : String
String this The string to reverse.
return String

SubTokens() public static method

public static SubTokens ( this Text, UInt16 Length ) : IEnumerable
Text this
Length System.UInt16
return IEnumerable

SubstringMax() public static method

Return a substring of the given maximum length.
public static SubstringMax ( this Text, Int32 Length ) : String
Text this A text.
Length System.Int32 The maximum length of the substring.
return String

ToBase64() public static method

public static ToBase64 ( this myString ) : String
myString this
return String

ToKeyValuePairs() public static method

Converts the given enumeration of strings into an enumeration of key-value-pairs.
public static ToKeyValuePairs ( this Text ) : String>>.IEnumerable
Text this An enumeration of strings.
return String>>.IEnumerable

ToUTF8Bytes() public static method

public static ToUTF8Bytes ( this Text ) : Byte[]
Text this
return Byte[]

ToUTF8String() public static method

public static ToUTF8String ( this ArrayOfBytes, Int32 NumberOfBytes = -1, System.Boolean ThrowException = true ) : String
ArrayOfBytes this
NumberOfBytes System.Int32
ThrowException System.Boolean
return String