C# Class SharpMod.Helper.HelperExtensions

These are some extensions which let the code look nice. These functions are often found in other scripting programming languages like ruby
Datei anzeigen Open project: txdv/sharpmod

Public Methods

Method Description
Append ( this stringBuilder, string cmd ) : StringBuilder
Contains ( this text, char c ) : bool
Escape ( this c ) : string
First ( this array ) : string
GetInnerText ( this doc, string tag ) : string
GetXmlElement ( this xmldoc, string name ) : XmlElement
IsMessage ( this type ) : bool
IsStruct ( this type ) : bool
Join ( this stringArray, char c ) : string
Join ( this stringArray, int startIndex, char c ) : string
Join ( this stringArray, int startIndex, string delimeter ) : string
Join ( this stringArray, string delimeter ) : string
Last ( this array ) : string

Returns the last element in a string array

Shift ( this text, char c ) : string
Shift ( this arr ) : string[]
Split ( this text, char c ) : string[]
ToFloat ( this timespan ) : float
ToTimeSpan ( this time ) : System.TimeSpan

Method Details

Append() public static method

public static Append ( this stringBuilder, string cmd ) : StringBuilder
stringBuilder this
cmd string
return StringBuilder

Contains() public static method

public static Contains ( this text, char c ) : bool
text this
c char
return bool

Escape() public static method

public static Escape ( this c ) : string
c this
return string

First() public static method

public static First ( this array ) : string
array this
return string

GetInnerText() public static method

public static GetInnerText ( this doc, string tag ) : string
doc this
tag string
return string

GetXmlElement() public static method

public static GetXmlElement ( this xmldoc, string name ) : XmlElement
xmldoc this
name string
return System.Xml.XmlElement

IsMessage() public static method

public static IsMessage ( this type ) : bool
type this
return bool

IsStruct() public static method

public static IsStruct ( this type ) : bool
type this
return bool

Join() public static method

public static Join ( this stringArray, char c ) : string
stringArray this
c char
return string

Join() public static method

public static Join ( this stringArray, int startIndex, char c ) : string
stringArray this
startIndex int
c char
return string

Join() public static method

public static Join ( this stringArray, int startIndex, string delimeter ) : string
stringArray this
startIndex int
delimeter string
return string

Join() public static method

public static Join ( this stringArray, string delimeter ) : string
stringArray this
delimeter string
return string

Last() public static method

Returns the last element in a string array
public static Last ( this array ) : string
array this /// A string array ///
return string

Shift() public static method

public static Shift ( this text, char c ) : string
text this
c char
return string

Shift() public static method

public static Shift ( this arr ) : string[]
arr this
return string[]

Split() public static method

public static Split ( this text, char c ) : string[]
text this
c char
return string[]

ToFloat() public static method

public static ToFloat ( this timespan ) : float
timespan this
return float

ToTimeSpan() public static method

public static ToTimeSpan ( this time ) : System.TimeSpan
time this
return System.TimeSpan