C# Class Telerik.ILS.Common.StringExtensions

A Static class that extends string type
Show file Open project: vladislav-karamfilov/TelerikAcademy

Public Methods

Method Description
CapitalizeFirstLetter ( this input ) : string

Capitalizes the first letter of the current instance

ConvertCyrillicToLatinLetters ( this input ) : string

Replaces all cyrillic letters with their latin representations in the current instance.

ConvertLatinToCyrillicKeyboard ( this input ) : string

Replaces all latin letters with their cyrillic representations in the current instance.

GetFileExtension ( this fileName ) : string

Returns the file extension of the current instance interpreted as a file name.

GetFirstCharacters ( this input, int charsCount ) : string

Returns the first charsCount number of characters of the current instance.

GetStringBetween ( this input, string startString, string endString, int startFrom ) : string

Returns the substring between startString and endString starting from startFrom index of the current instance.

ToBoolean ( this input ) : bool

Converts the current instance to a System.Boolean value.

ToByteArray ( this input ) : byte[]

Converts the current instance to a byte array value.

ToContentType ( this fileExtension ) : string

Converts the current instance interpreted as a file extension to a content type value.

ToDateTime ( this input ) : System.DateTime

Converts the current instance to a System.DateTime value.

ToInteger ( this input ) : int

Converts the current instance to an System.Int32 value.

ToLong ( this input ) : long

Converts the current instance to an System.Int64 value.

ToMd5Hash ( this input ) : string

Returns the MD5 hash value of the current instance.

ToShort ( this input ) : short

Converts the current instance to an System.Int16 value.

ToValidLatinFileName ( this input ) : string

Returns a string in which all cyrillic letters in the current instance are replaced by their latin representations, all white spaces are replaced by hyphens and all non-alphanumeric characters (excluding "." and "-") are removed.

ToValidUsername ( this input ) : string

Returns a string in which all cyrillic letters in the current instance are replaced by their latin representations and all non-alphanumeric characters (excluding ".") are removed.

Method Details

CapitalizeFirstLetter() public static method

Capitalizes the first letter of the current instance
public static CapitalizeFirstLetter ( this input ) : string
input this The current instance.
return string

ConvertCyrillicToLatinLetters() public static method

Replaces all cyrillic letters with their latin representations in the current instance.
public static ConvertCyrillicToLatinLetters ( this input ) : string
input this The current instance.
return string

ConvertLatinToCyrillicKeyboard() public static method

Replaces all latin letters with their cyrillic representations in the current instance.
public static ConvertLatinToCyrillicKeyboard ( this input ) : string
input this The current instance.
return string

GetFileExtension() public static method

Returns the file extension of the current instance interpreted as a file name.
public static GetFileExtension ( this fileName ) : string
fileName this The current instance interpreted as a file name.
return string

GetFirstCharacters() public static method

Returns the first charsCount number of characters of the current instance.
public static GetFirstCharacters ( this input, int charsCount ) : string
input this The current instance.
charsCount int The number of characters to be taken from the start of the current instance.
return string

GetStringBetween() public static method

Returns the substring between startString and endString starting from startFrom index of the current instance.
public static GetStringBetween ( this input, string startString, string endString, int startFrom ) : string
input this The current instance.
startString string The string from which the result string starts.
endString string The string at which the result string ends.
startFrom int The zero-based character position from which the search starts.
return string

ToBoolean() public static method

Converts the current instance to a System.Boolean value.
public static ToBoolean ( this input ) : bool
input this The current instance.
return bool

ToByteArray() public static method

Converts the current instance to a byte array value.
public static ToByteArray ( this input ) : byte[]
input this The current instance.
return byte[]

ToContentType() public static method

Converts the current instance interpreted as a file extension to a content type value.
public static ToContentType ( this fileExtension ) : string
fileExtension this The current instance interpreted as a file extension.
return string

ToDateTime() public static method

Converts the current instance to a System.DateTime value.
public static ToDateTime ( this input ) : System.DateTime
input this The current instance.
return System.DateTime

ToInteger() public static method

Converts the current instance to an System.Int32 value.
public static ToInteger ( this input ) : int
input this The current instance.
return int

ToLong() public static method

Converts the current instance to an System.Int64 value.
public static ToLong ( this input ) : long
input this The current instance.
return long

ToMd5Hash() public static method

Returns the MD5 hash value of the current instance.
public static ToMd5Hash ( this input ) : string
input this The current instance.
return string

ToShort() public static method

Converts the current instance to an System.Int16 value.
public static ToShort ( this input ) : short
input this The current instance.
return short

ToValidLatinFileName() public static method

Returns a string in which all cyrillic letters in the current instance are replaced by their latin representations, all white spaces are replaced by hyphens and all non-alphanumeric characters (excluding "." and "-") are removed.
public static ToValidLatinFileName ( this input ) : string
input this The current instance.
return string

ToValidUsername() public static method

Returns a string in which all cyrillic letters in the current instance are replaced by their latin representations and all non-alphanumeric characters (excluding ".") are removed.
public static ToValidUsername ( this input ) : string
input this The current instance.
return string