C# Class Microsoft.Common.Core.StringExtensions

Mostra file Open project: Microsoft/RTVS

Public Methods

Method Description
ContainsIgnoreCase ( this s, string prefix ) : bool
EndsWith ( this s, char ch ) : bool
EndsWithIgnoreCase ( this s, string suffix ) : bool
EndsWithOrdinal ( this s, string suffix ) : bool
EqualsIgnoreCase ( this s, string other ) : bool
EqualsOrdinal ( this s, string other ) : bool
FormatCurrent ( this format ) : string
FormatCurrent ( this format, object arg ) : string
FormatInvariant ( this format ) : string
FormatInvariant ( this format, object arg ) : string
GetDefaultLineBreakSequence ( this s ) : string

Given a string (typically text from a file) determines which line break sequence should be used when editing or formatting the file. If no line breaks found, LF is returned.

GetSHA512Hash ( this input ) : string
IndexOfIgnoreCase ( this s, string searchFor ) : int
IndexOfIgnoreCase ( this s, string searchFor, int startIndex ) : int
IndexOfOrdinal ( this s, string searchFor ) : int
LastIndexOfIgnoreCase ( this s, string searchFor ) : int
LastIndexOfIgnoreCase ( this s, string searchFor, int startIndex ) : int
RemoveWhiteSpaceLines ( this text ) : string
Replace ( this s, string oldValue, string newValue, int start, int length ) : string
StartsWithIgnoreCase ( this s, string prefix ) : bool
StartsWithOrdinal ( this s, string prefix ) : bool
SubstringToHex ( this s, int position, int count ) : int
ToDateTimeOrDefault ( this value ) : System.DateTime
ToLongOrDefault ( this value ) : long
TrimQuotes ( this s ) : string

Method Details

ContainsIgnoreCase() public static method

public static ContainsIgnoreCase ( this s, string prefix ) : bool
s this
prefix string
return bool

EndsWith() public static method

public static EndsWith ( this s, char ch ) : bool
s this
ch char
return bool

EndsWithIgnoreCase() public static method

public static EndsWithIgnoreCase ( this s, string suffix ) : bool
s this
suffix string
return bool

EndsWithOrdinal() public static method

public static EndsWithOrdinal ( this s, string suffix ) : bool
s this
suffix string
return bool

EqualsIgnoreCase() public static method

public static EqualsIgnoreCase ( this s, string other ) : bool
s this
other string
return bool

EqualsOrdinal() public static method

public static EqualsOrdinal ( this s, string other ) : bool
s this
other string
return bool

FormatCurrent() public static method

public static FormatCurrent ( this format ) : string
format this
return string

FormatCurrent() public static method

public static FormatCurrent ( this format, object arg ) : string
format this
arg object
return string

FormatInvariant() public static method

public static FormatInvariant ( this format ) : string
format this
return string

FormatInvariant() public static method

public static FormatInvariant ( this format, object arg ) : string
format this
arg object
return string

GetDefaultLineBreakSequence() public static method

Given a string (typically text from a file) determines which line break sequence should be used when editing or formatting the file. If no line breaks found, LF is returned.
public static GetDefaultLineBreakSequence ( this s ) : string
s this
return string

GetSHA512Hash() public static method

public static GetSHA512Hash ( this input ) : string
input this
return string

IndexOfIgnoreCase() public static method

public static IndexOfIgnoreCase ( this s, string searchFor ) : int
s this
searchFor string
return int

IndexOfIgnoreCase() public static method

public static IndexOfIgnoreCase ( this s, string searchFor, int startIndex ) : int
s this
searchFor string
startIndex int
return int

IndexOfOrdinal() public static method

public static IndexOfOrdinal ( this s, string searchFor ) : int
s this
searchFor string
return int

LastIndexOfIgnoreCase() public static method

public static LastIndexOfIgnoreCase ( this s, string searchFor ) : int
s this
searchFor string
return int

LastIndexOfIgnoreCase() public static method

public static LastIndexOfIgnoreCase ( this s, string searchFor, int startIndex ) : int
s this
searchFor string
startIndex int
return int

RemoveWhiteSpaceLines() public static method

public static RemoveWhiteSpaceLines ( this text ) : string
text this
return string

Replace() public static method

public static Replace ( this s, string oldValue, string newValue, int start, int length ) : string
s this
oldValue string
newValue string
start int
length int
return string

StartsWithIgnoreCase() public static method

public static StartsWithIgnoreCase ( this s, string prefix ) : bool
s this
prefix string
return bool

StartsWithOrdinal() public static method

public static StartsWithOrdinal ( this s, string prefix ) : bool
s this
prefix string
return bool

SubstringToHex() public static method

public static SubstringToHex ( this s, int position, int count ) : int
s this
position int
count int
return int

ToDateTimeOrDefault() public static method

public static ToDateTimeOrDefault ( this value ) : System.DateTime
value this
return System.DateTime

ToLongOrDefault() public static method

public static ToLongOrDefault ( this value ) : long
value this
return long

TrimQuotes() public static method

public static TrimQuotes ( this s ) : string
s this
return string