C# Class FubuCore.StringExtensions

Datei anzeigen Open project: jmarnold/fubumvc-testrunner

Public Methods

Method Description
AppendPath ( this path ) : string

Equivalent of FileSystem.Combine( [Union of path, parts] )

Capitalize ( this stringValue ) : string

Converts the string to Title Case

CombineToPath ( this path, string root ) : string

If the path is rooted, just returns the path. Otherwise, combines root & path

ConvertCRLFToBreaks ( this plainText ) : string

Formats a multi-line string for display on the web

DirectoryPath ( this path ) : string
EqualsIgnoreCase ( this thisString, string otherString ) : bool

Performs a case-insensitive comparison of strings

HtmlAttributeEncode ( this unEncoded ) : string
HtmlDecode ( this encoded ) : string
HtmlEncode ( this unEncoded ) : string
IfNotNull ( this target, Action continuation ) : void
IsEmpty ( this stringValue ) : bool
IsNotEmpty ( this stringValue ) : bool
IsNotEmpty ( this stringValue, Action action ) : void
IsValidNumber ( this number ) : bool
IsValidNumber ( this number, CultureInfo culture ) : bool
ParentDirectory ( this path ) : string

Retrieve the parent directory of a directory or file Shortcut to Path.GetDirectoryName(path)

PathRelativeTo ( this path, string root ) : string
ReadLines ( this text ) : IEnumerable

Reads text and returns an enumerable of strings for each line

ReadLines ( this text, Action callback ) : void

Reads text and calls back for each line of text

ToBool ( this stringValue ) : bool
ToDateTime ( this dateTimeValue ) : System.DateTime

Returns a DateTime value parsed from the dateTimeValue parameter.

ToDelimitedArray ( this content ) : string[]
ToDelimitedArray ( this content, char delimiter ) : string[]
ToFormat ( this stringFormat ) : string
ToFullPath ( this path ) : string
ToGmtFormattedDate ( this date ) : string
UrlDecode ( this encoded ) : string
UrlEncode ( this unEncoded ) : string
getPathParts ( this path ) : IList

Method Details

AppendPath() public static method

Equivalent of FileSystem.Combine( [Union of path, parts] )
public static AppendPath ( this path ) : string
path this
return string

Capitalize() public static method

Converts the string to Title Case
public static Capitalize ( this stringValue ) : string
stringValue this
return string

CombineToPath() public static method

If the path is rooted, just returns the path. Otherwise, combines root & path
public static CombineToPath ( this path, string root ) : string
path this
root string
return string

ConvertCRLFToBreaks() public static method

Formats a multi-line string for display on the web
public static ConvertCRLFToBreaks ( this plainText ) : string
plainText this
return string

DirectoryPath() public static method

public static DirectoryPath ( this path ) : string
path this
return string

EqualsIgnoreCase() public static method

Performs a case-insensitive comparison of strings
public static EqualsIgnoreCase ( this thisString, string otherString ) : bool
thisString this
otherString string
return bool

HtmlAttributeEncode() public static method

public static HtmlAttributeEncode ( this unEncoded ) : string
unEncoded this
return string

HtmlDecode() public static method

public static HtmlDecode ( this encoded ) : string
encoded this
return string

HtmlEncode() public static method

public static HtmlEncode ( this unEncoded ) : string
unEncoded this
return string

IfNotNull() public static method

public static IfNotNull ( this target, Action continuation ) : void
target this
continuation Action
return void

IsEmpty() public static method

public static IsEmpty ( this stringValue ) : bool
stringValue this
return bool

IsNotEmpty() public static method

public static IsNotEmpty ( this stringValue ) : bool
stringValue this
return bool

IsNotEmpty() public static method

public static IsNotEmpty ( this stringValue, Action action ) : void
stringValue this
action Action
return void

IsValidNumber() public static method

public static IsValidNumber ( this number ) : bool
number this
return bool

IsValidNumber() public static method

public static IsValidNumber ( this number, CultureInfo culture ) : bool
number this
culture System.Globalization.CultureInfo
return bool

ParentDirectory() public static method

Retrieve the parent directory of a directory or file Shortcut to Path.GetDirectoryName(path)
public static ParentDirectory ( this path ) : string
path this
return string

PathRelativeTo() public static method

public static PathRelativeTo ( this path, string root ) : string
path this
root string
return string

ReadLines() public static method

Reads text and returns an enumerable of strings for each line
public static ReadLines ( this text ) : IEnumerable
text this
return IEnumerable

ReadLines() public static method

Reads text and calls back for each line of text
public static ReadLines ( this text, Action callback ) : void
text this
callback Action
return void

ToBool() public static method

public static ToBool ( this stringValue ) : bool
stringValue this
return bool

ToDateTime() public static method

Returns a DateTime value parsed from the dateTimeValue parameter.
public static ToDateTime ( this dateTimeValue ) : System.DateTime
dateTimeValue this A valid, parseable DateTime value
return System.DateTime

ToDelimitedArray() public static method

public static ToDelimitedArray ( this content ) : string[]
content this
return string[]

ToDelimitedArray() public static method

public static ToDelimitedArray ( this content, char delimiter ) : string[]
content this
delimiter char
return string[]

ToFormat() public static method

public static ToFormat ( this stringFormat ) : string
stringFormat this
return string

ToFullPath() public static method

public static ToFullPath ( this path ) : string
path this
return string

ToGmtFormattedDate() public static method

public static ToGmtFormattedDate ( this date ) : string
date this
return string

UrlDecode() public static method

public static UrlDecode ( this encoded ) : string
encoded this
return string

UrlEncode() public static method

public static UrlEncode ( this unEncoded ) : string
unEncoded this
return string

getPathParts() public static method

public static getPathParts ( this path ) : IList
path this
return IList