C# Class Organic.Extensions

Mostra file Open project: SirCmpwn/organic

Public Methods

Method Description
ContainsKey ( this value, string key ) : bool
GetValue ( this value, string key ) : ushort
SafeContains ( this value, char needle ) : bool
SafeIndexOf ( this value, char needle ) : int
SafeIndexOf ( this value, char needle, int startIndex ) : int
SafeIndexOfParenthesis ( this value, char needle ) : int
SafeIndexOfParenthesis ( this value, char needle, int startIndex ) : int
SafeSplit ( this value ) : string[]

Works the same as String.Split, but will not split if the requested characters are within a character or string literal.

TrimComments ( this value ) : string

Given a string, such as "SET A, B ; test", it removes all comments from that string.

TrimExcessWhitespace ( this value ) : string

Removes unneccissary whitespace from a line of code.

Unescape ( this value ) : string

Given a string with escaped characters, this will return the unescaped version. Example: "Test\\nstring" becomes "Test\nstring"

Method Details

ContainsKey() public static method

public static ContainsKey ( this value, string key ) : bool
value this
key string
return bool

GetValue() public static method

public static GetValue ( this value, string key ) : ushort
value this
key string
return ushort

SafeContains() public static method

public static SafeContains ( this value, char needle ) : bool
value this
needle char
return bool

SafeIndexOf() public static method

public static SafeIndexOf ( this value, char needle ) : int
value this
needle char
return int

SafeIndexOf() public static method

public static SafeIndexOf ( this value, char needle, int startIndex ) : int
value this
needle char
startIndex int
return int

SafeIndexOfParenthesis() public static method

public static SafeIndexOfParenthesis ( this value, char needle ) : int
value this
needle char
return int

SafeIndexOfParenthesis() public static method

public static SafeIndexOfParenthesis ( this value, char needle, int startIndex ) : int
value this
needle char
startIndex int
return int

SafeSplit() public static method

Works the same as String.Split, but will not split if the requested characters are within a character or string literal.
public static SafeSplit ( this value ) : string[]
value this
return string[]

TrimComments() public static method

Given a string, such as "SET A, B ; test", it removes all comments from that string.
public static TrimComments ( this value ) : string
value this
return string

TrimExcessWhitespace() public static method

Removes unneccissary whitespace from a line of code.
public static TrimExcessWhitespace ( this value ) : string
value this
return string

Unescape() public static method

Given a string with escaped characters, this will return the unescaped version. Example: "Test\\nstring" becomes "Test\nstring"
public static Unescape ( this value ) : string
value this
return string