C# Class CtcApi.Extensions.StringExtensions

Set the EXTRA_VERBOSE build flag to enable Trace-level log output for for members of this class.
Mostrar archivo Open project: BellevueCollege/CtcApi

Public Methods

Method Description
CombinePath ( this src ) : string

Combines two or more strings into a valid file/folder path.

CombineUrl ( this src ) : string

Combines two or more strings into a URL.

IsInt ( this value ) : bool

Identifies whether or not a string can be converted to an int

IsNumber ( this value ) : bool

Identifies whether or not a string can be converted to a number

Mash ( this src, string seperator = "," ) : string

Joins an array of strings into one.

Nullify ( this value ) : string

Converts an empty String to null

SafeToInt32 ( this value, int defaultValue ) : int

Safely converts a string to an int.

TitleCase ( this src ) : string

Capitalizes the first letter of each word in the string.

See http://tiny.cc/wzawkw

This method has no affect on strings that are already upper case. Set the EXTRA_VERBOSE build flag to enable Trace-level log output.
ToFile ( this str, string filename ) : bool

Saves the string to a file.

Method Details

CombinePath() public static method

Combines two or more strings into a valid file/folder path.
public static CombinePath ( this src ) : string
src this
return string

CombineUrl() public static method

Combines two or more strings into a URL.
public static CombineUrl ( this src ) : string
src this
return string

IsInt() public static method

Identifies whether or not a string can be converted to an int
public static IsInt ( this value ) : bool
value this The to evaluate.
return bool

IsNumber() public static method

Identifies whether or not a string can be converted to a number
public static IsNumber ( this value ) : bool
value this The to evaluate.
return bool

Mash() public static method

Joins an array of strings into one.
public static Mash ( this src, string seperator = "," ) : string
src this
seperator string
return string

Nullify() public static method

Converts an empty String to null
public static Nullify ( this value ) : string
value this The to evaluate.
return string

SafeToInt32() public static method

Safely converts a string to an int.
public static SafeToInt32 ( this value, int defaultValue ) : int
value this
defaultValue int A default value to return if the cannot be converted to an int.
return int

TitleCase() public static method

Capitalizes the first letter of each word in the string.

See http://tiny.cc/wzawkw

This method has no affect on strings that are already upper case. Set the EXTRA_VERBOSE build flag to enable Trace-level log output.
public static TitleCase ( this src ) : string
src this
return string

ToFile() public static method

Saves the string to a file.
public static ToFile ( this str, string filename ) : bool
str this
filename string
return bool