C# Class Open.Core.Helpers.StringHelper

Utility methods for working with strings.
Exibir arquivo Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
FormatToString ( object value, ToString toString ) : string

Converts the given object to a string, formatting appropirate null/undefined/empty-string versions if the variable is in any of those states.

HasValue ( string value ) : bool

Checks the string to make sure it is not null, undefines, empty, or just white-space.

IsCapital ( string value ) : bool

Determines if the specified value is in capitals.

RemoveEnd ( string text, string remove ) : string

Removes the specified text from the end of a string if it's present (not case sensitive).

RemoveStart ( string text, string remove ) : string

Removes the specified text from the start of a string if it's present (not case sensitive).

StripPath ( string url ) : string

Removes the preceeding path of a URL returning just the end segment.

ToCamelCase ( string value ) : string

Converts the given string to camelCase.

ToSentenceCase ( string value ) : string

Converts the given string to SentenceCase.

Private Methods

Method Description
FormatToString ( object value ) : string

Method Details

FormatToString() public method

Converts the given object to a string, formatting appropirate null/undefined/empty-string versions if the variable is in any of those states.
public FormatToString ( object value, ToString toString ) : string
value object The value to convert.
toString ToString Function that performs the conversion to a string.
return string

HasValue() public method

Checks the string to make sure it is not null, undefines, empty, or just white-space.
public HasValue ( string value ) : bool
value string The value to examine.
return bool

IsCapital() public method

Determines if the specified value is in capitals.
public IsCapital ( string value ) : bool
value string The value to examine.
return bool

RemoveEnd() public method

Removes the specified text from the end of a string if it's present (not case sensitive).
public RemoveEnd ( string text, string remove ) : string
text string The string to effect.
remove string The text to remove.
return string

RemoveStart() public method

Removes the specified text from the start of a string if it's present (not case sensitive).
public RemoveStart ( string text, string remove ) : string
text string The string to effect.
remove string The text to remove.
return string

StripPath() public method

Removes the preceeding path of a URL returning just the end segment.
public StripPath ( string url ) : string
url string The URL to process.
return string

ToCamelCase() public method

Converts the given string to camelCase.
public ToCamelCase ( string value ) : string
value string The value to convert.
return string

ToSentenceCase() public method

Converts the given string to SentenceCase.
public ToSentenceCase ( string value ) : string
value string The value to convert.
return string