C# Class Codaxy.Common.Text.StringExtensions

ファイルを表示 Open project: codaxy/common

Public Methods

Method Description
AfterLastOf ( this s, char c ) : String
AfterLastOfAny ( this s ) : String
Contains ( this source, string toCheck, StringComparison comp ) : bool
Enclose ( this s, String within ) : string
Enclose ( this s, String left, String right ) : string
Enclose ( this s, char within ) : string
FormatWith ( this format ) : String
Indent ( this s, int count ) : string
IsEqualToAnyOf ( this s ) : bool
IsNullOrEmpty ( this s ) : bool
JoinNonEmpty ( String sep ) : String
LeftOf ( this s, char c, bool emptyIfNotFound ) : String
LeftPart ( this s, int n ) : String
Quote ( this s ) : string
QuoteSingle ( this s ) : string
Replace ( this original, string pattern, string replacement, StringComparison comparisonType ) : string
ReplaceNullOrEmptyWith ( this s, String replacement ) : String
Reverse ( this s ) : string
SplitKeep ( this s ) : IEnumerable

Split string using given delimiters and keeps delimiters. No empty string are returned.

ToCamelCase ( this source ) : string
ToPascalCase ( this source ) : string

Method Details

AfterLastOf() public static method

public static AfterLastOf ( this s, char c ) : String
s this
c char
return String

AfterLastOfAny() public static method

public static AfterLastOfAny ( this s ) : String
s this
return String

Contains() public static method

public static Contains ( this source, string toCheck, StringComparison comp ) : bool
source this
toCheck string
comp StringComparison
return bool

Enclose() public static method

public static Enclose ( this s, String within ) : string
s this
within String
return string

Enclose() public static method

public static Enclose ( this s, String left, String right ) : string
s this
left String
right String
return string

Enclose() public static method

public static Enclose ( this s, char within ) : string
s this
within char
return string

FormatWith() public static method

public static FormatWith ( this format ) : String
format this
return String

Indent() public static method

public static Indent ( this s, int count ) : string
s this
count int
return string

IsEqualToAnyOf() public static method

public static IsEqualToAnyOf ( this s ) : bool
s this
return bool

IsNullOrEmpty() public static method

public static IsNullOrEmpty ( this s ) : bool
s this
return bool

JoinNonEmpty() public static method

public static JoinNonEmpty ( String sep ) : String
sep String
return String

LeftOf() public static method

public static LeftOf ( this s, char c, bool emptyIfNotFound ) : String
s this
c char
emptyIfNotFound bool
return String

LeftPart() public static method

public static LeftPart ( this s, int n ) : String
s this
n int
return String

Quote() public static method

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

QuoteSingle() public static method

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

Replace() public static method

public static Replace ( this original, string pattern, string replacement, StringComparison comparisonType ) : string
original this
pattern string
replacement string
comparisonType StringComparison
return string

ReplaceNullOrEmptyWith() public static method

public static ReplaceNullOrEmptyWith ( this s, String replacement ) : String
s this
replacement String
return String

Reverse() public static method

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

SplitKeep() public static method

Split string using given delimiters and keeps delimiters. No empty string are returned.
public static SplitKeep ( this s ) : IEnumerable
s this String instance.
return IEnumerable

ToCamelCase() public static method

public static ToCamelCase ( this source ) : string
source this
return string

ToPascalCase() public static method

public static ToPascalCase ( this source ) : string
source this
return string