C# 클래스 BF2Statistics.StringExtensions

파일 보기 프로젝트 열기: BF2Statistics/ControlCenter

공개 메소드들

메소드 설명
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