C# Класс BF2Statistics.StringExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
CutTolength ( this str, int maxLength ) : string

Returns the input string at the maximum lenght provided. Excess string length will be removed from the end of the string. This method is very similar to using String.SubString(0, maxLength), but without an exception being thrown if the lentgh is greater than the length of the string.

EscapeXML ( this s ) : string

Escapes this string, so it may be stored inside an XML format

GetMD5Hash ( this input, bool upperCase = true, Encoding Encoding = null ) : string

Converts the input string into its MD5 Hex variant

IndexesOf ( this str, string value ) : List

Returns all the index's of the given string input

Inverse ( this input ) : string

Returns this string, in reverse order (abcde becomes edcba)

LowercaseFirst ( this s ) : string

Takes a string, and Lowercases the first letter

MakeFileNameSafe ( this fileName ) : string

Removes any invalid file path characters from this string

Repeat ( this input, int count = 1, string delimiter = "" ) : string

Repeats the current string the number of times specified

SplitBySize ( this str, int chunkSize ) : IEnumerable

Returns an Enumeration of this string, split by the specified size

ToTitleCase ( this s ) : string

Converts each word's first letter in the string to Uppercase (Invarient Culture)

ToTitleCase ( this s, CultureInfo cultureInfo ) : string

Converts each word's first letter in the string to Uppercase using the specified culture

UnescapeXML ( this s ) : string

Removes and XML converted formating back into its original value.

UppercaseFirst ( this s ) : string

Takes a string, and Uppercases the first letter

Описание методов

CutTolength() публичный статический Метод

Returns the input string at the maximum lenght provided. Excess string length will be removed from the end of the string. This method is very similar to using String.SubString(0, maxLength), but without an exception being thrown if the lentgh is greater than the length of the string.
public static CutTolength ( this str, int maxLength ) : string
str this
maxLength int
Результат string

EscapeXML() публичный статический Метод

Escapes this string, so it may be stored inside an XML format
public static EscapeXML ( this s ) : string
s this
Результат string

GetMD5Hash() публичный статический Метод

Converts the input string into its MD5 Hex variant
public static GetMD5Hash ( this input, bool upperCase = true, Encoding Encoding = null ) : string
input this
upperCase bool Uppercase the characters?
Encoding System.Text.Encoding The encoding of the string. Default is UTF8
Результат string

IndexesOf() публичный статический Метод

Returns all the index's of the given string input
public static IndexesOf ( this str, string value ) : List
str this
value string
Результат List

Inverse() публичный статический Метод

Returns this string, in reverse order (abcde becomes edcba)
public static Inverse ( this input ) : string
input this
Результат string

LowercaseFirst() публичный статический Метод

Takes a string, and Lowercases the first letter
public static LowercaseFirst ( this s ) : string
s this The input string
Результат string

MakeFileNameSafe() публичный статический Метод

Removes any invalid file path characters from this string
public static MakeFileNameSafe ( this fileName ) : string
fileName this
Результат string

Repeat() публичный статический Метод

Repeats the current string the number of times specified
public static Repeat ( this input, int count = 1, string delimiter = "" ) : string
input this The string that is being repeated
count int The number of times to repeat this string
delimiter string The sequence of one or more characters used to specify the boundary between repeats
Результат string

SplitBySize() публичный статический Метод

Returns an Enumeration of this string, split by the specified size
public static SplitBySize ( this str, int chunkSize ) : IEnumerable
str this
chunkSize int The size of each chunk, in which this string is split by
Результат IEnumerable

ToTitleCase() публичный статический Метод

Converts each word's first letter in the string to Uppercase (Invarient Culture)
public static ToTitleCase ( this s ) : string
s this the input string
Результат string

ToTitleCase() публичный статический Метод

Converts each word's first letter in the string to Uppercase using the specified culture
public static ToTitleCase ( this s, CultureInfo cultureInfo ) : string
s this
cultureInfo System.Globalization.CultureInfo The culture info to use
Результат string

UnescapeXML() публичный статический Метод

Removes and XML converted formating back into its original value.
public static UnescapeXML ( this s ) : string
s this
Результат string

UppercaseFirst() публичный статический Метод

Takes a string, and Uppercases the first letter
public static UppercaseFirst ( this s ) : string
s this The input string
Результат string