C# Class GitHub.Extensions.StringExtensions

显示文件 Open project: github/VisualStudio

Public Methods

Method Description
Contains ( this s, string expectedSubstring, System.StringComparison comparison ) : bool
ContainsAny ( this s, IEnumerable characters ) : bool
DebugRepresentation ( [ s ) : string
RemoveSurroundingQuotes ( this s ) : string
StartsWith ( [ s, char c ) : bool
ToInt32 ( this s ) : Int32
ToUriSafe ( this url ) : Uri
Wrap ( this text, int maxLength = 72 ) : string

Wrap a string to the specified length.

Private Methods

Method Description
EnsureEndsWith ( [ s, char c ) : string
EnsureStartsWith ( [ s, char c ) : string
LeftBeforeLast ( [ s, string search ) : string
NormalizePath ( [ path ) : string
ParseFileName ( [ path ) : string
ParseParentDirectory ( [ path ) : string
RightAfter ( [ s, string search ) : string
RightAfterLast ( this s, string search ) : string
ToNullIfEmpty ( [ s ) : string
TrimEnd ( [ s, string suffix ) : string

Method Details

Contains() public static method

public static Contains ( this s, string expectedSubstring, System.StringComparison comparison ) : bool
s this
expectedSubstring string
comparison System.StringComparison
return bool

ContainsAny() public static method

public static ContainsAny ( this s, IEnumerable characters ) : bool
s this
characters IEnumerable
return bool

DebugRepresentation() public static method

public static DebugRepresentation ( [ s ) : string
s [
return string

RemoveSurroundingQuotes() public static method

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

StartsWith() public static method

public static StartsWith ( [ s, char c ) : bool
s [
c char
return bool

ToInt32() public static method

public static ToInt32 ( this s ) : Int32
s this
return System.Int32

ToUriSafe() public static method

public static ToUriSafe ( this url ) : Uri
url this
return System.Uri

Wrap() public static method

Wrap a string to the specified length.
public static Wrap ( this text, int maxLength = 72 ) : string
text this The text string to wrap
maxLength int The character length to wrap at
return string