C# Class Signum.Utilities.StringExtensions

Mostrar archivo Open project: signumsoftware/framework

Public Methods

Method Description
Add ( this str, string separator, string part ) : string
AddLine ( this str, string part ) : string
After ( this str, char separator ) : string

get the substring after the first occurence of the separator

After ( this str, string separator ) : string

get the substring after the first occurence of the separator

AfterLast ( this str, char separator ) : string

get the substring after the last occurence of the separator

AfterLast ( this str, string separator ) : string

get the substring after the last occurence of the separator

AppendLines ( this sb, IEnumerable strings ) : StringBuilder
AssertHasText ( this str, string errorMessage ) : string
Before ( this str, char separator ) : string

get the substring before the first occurence of the separator

Before ( this str, string separator ) : string

get the substring before the first occurence of the separator

BeforeLast ( this str, char separator ) : string

get the substring before the last occurence of the separator

BeforeLast ( this str, string separator ) : string

get the substring before the last occurence of the separator

Between ( this str, char firstSeparator, char secondSeparator = (char)0 ) : string
Between ( this str, string firstSeparator, string secondSeparator = null ) : string
Combine ( this separator ) : string
CombineIfNotEmpty ( this separator ) : string
Contains ( this source, string toCheck, System.StringComparison comp ) : bool
ContinuesWith ( this str, string subString, int pos ) : bool
CountRepetitions ( this text, string part ) : int
DefaultText ( this str, string defaultText ) : string
End ( this str, int numChars ) : string
Etc ( this str, int max ) : string
Etc ( this str, int max, string etcString ) : string
FirstLower ( this str ) : string
FirstNonEmptyLine ( this str ) : string
FirstUpper ( this str ) : string
FormatWith ( this pattern ) : string
FormatWith ( this format, IFormatProvider provider ) : string
FormatWith ( this format, object arg0 ) : string
FormatWith ( this format, object arg0, object arg1 ) : string
FormatWith ( this format, object arg0, object arg1, object arg2 ) : string
Indent ( this str, int numChars ) : string
Indent ( this str, int numChars, char indentChar ) : string
Like ( this str, string pattern ) : bool
Lines ( this str ) : string[]
PadChopLeft ( this str, int length ) : string
PadChopRight ( this str, int length ) : string
RemoveChars ( this str ) : string
RemoveDiacritics ( this s ) : string
RemoveEnd ( this str, int numChars ) : string
RemoveStart ( this str, int numChars ) : string
Replace ( this str, char>.Dictionary replacements ) : string
Replace ( this str, string>.Dictionary replacements ) : string
Replicate ( this str, int times ) : string
Reverse ( this str ) : string
SplitInGroupsOf ( this str, int maxChars ) : List
SplitNoEmpty ( this text ) : string[]
SplitNoEmpty ( this text, char separator ) : string[]
SplitNoEmpty ( this text, string separator ) : string[]
Start ( this str, int numChars ) : string
ToComputerSize ( this value ) : string
ToComputerSize ( this value, bool useAbbreviations ) : string
TryAfter ( this str, char separator ) : string

get the substring after the first occurence of the separator

TryAfter ( this str, string separator ) : string

get the substring after the first occurence of the separator

TryAfterLast ( this str, char separator ) : string

get the substring after the last occurence of the separator

TryAfterLast ( this str, string separator ) : string

get the substring after the last occurence of the separator

TryBefore ( this str, char separator ) : string

get the substring before the first occurence of the separator

TryBefore ( this str, string separator ) : string

get the substring before the first occurence of the separator

TryBeforeLast ( this str, char separator ) : string

get the substring before the last occurence of the separator

TryBeforeLast ( this str, string separator ) : string

get the substring before the last occurence of the separator

TryBetween ( this str, char firstSeparator, char secondSeparator = (char)0 ) : string
TryBetween ( this str, string firstSeparator, string secondSeparator = null ) : string
TryEnd ( this str, int numChars ) : string
TryRemoveEnd ( this str, int numChars ) : string
TryRemoveStart ( this str, int numChars ) : string
TryStart ( this str, int numChars ) : string
VerticalEtc ( this str, int maxLines, string etcString = "(...)" ) : string
Wildcards ( this fileName, IEnumerable wildcards ) : bool
Wildcards ( this fileName, string wildcard ) : bool

Private Methods

Method Description
HasText ( this str ) : bool
NotFound ( string str, char separator ) : InvalidOperationException
NotFound ( string str, string separator ) : InvalidOperationException

Method Details

Add() public static method

public static Add ( this str, string separator, string part ) : string
str this
separator string
part string
return string

AddLine() public static method

public static AddLine ( this str, string part ) : string
str this
part string
return string

After() public static method

get the substring after the first occurence of the separator
If the separator is not found in the string
public static After ( this str, char separator ) : string
str this
separator char
return string

After() public static method

get the substring after the first occurence of the separator
If the separator is not found in the string
public static After ( this str, string separator ) : string
str this
separator string
return string

AfterLast() public static method

get the substring after the last occurence of the separator
If the separator is not found in the string
public static AfterLast ( this str, char separator ) : string
str this
separator char
return string

AfterLast() public static method

get the substring after the last occurence of the separator
If the separator is not found in the string
public static AfterLast ( this str, string separator ) : string
str this
separator string
return string

AppendLines() public static method

public static AppendLines ( this sb, IEnumerable strings ) : StringBuilder
sb this
strings IEnumerable
return StringBuilder

AssertHasText() public static method

public static AssertHasText ( this str, string errorMessage ) : string
str this
errorMessage string
return string

Before() public static method

get the substring before the first occurence of the separator
If the separator is not found in the string
public static Before ( this str, char separator ) : string
str this
separator char
return string

Before() public static method

get the substring before the first occurence of the separator
If the separator is not found in the string
public static Before ( this str, string separator ) : string
str this
separator string
return string

BeforeLast() public static method

get the substring before the last occurence of the separator
If the separator is not found in the string
public static BeforeLast ( this str, char separator ) : string
str this
separator char
return string

BeforeLast() public static method

get the substring before the last occurence of the separator
If the separator is not found in the string
public static BeforeLast ( this str, string separator ) : string
str this
separator string
return string

Between() public static method

public static Between ( this str, char firstSeparator, char secondSeparator = (char)0 ) : string
str this
firstSeparator char
secondSeparator char
return string

Between() public static method

public static Between ( this str, string firstSeparator, string secondSeparator = null ) : string
str this
firstSeparator string
secondSeparator string
return string

Combine() public static method

public static Combine ( this separator ) : string
separator this
return string

CombineIfNotEmpty() public static method

public static CombineIfNotEmpty ( this separator ) : string
separator this
return string

Contains() public static method

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

ContinuesWith() public static method

public static ContinuesWith ( this str, string subString, int pos ) : bool
str this
subString string
pos int
return bool

CountRepetitions() public static method

public static CountRepetitions ( this text, string part ) : int
text this
part string
return int

DefaultText() public static method

public static DefaultText ( this str, string defaultText ) : string
str this
defaultText string
return string

End() public static method

public static End ( this str, int numChars ) : string
str this
numChars int
return string

Etc() public static method

public static Etc ( this str, int max ) : string
str this
max int
return string

Etc() public static method

public static Etc ( this str, int max, string etcString ) : string
str this
max int
etcString string
return string

FirstLower() public static method

public static FirstLower ( this str ) : string
str this
return string

FirstNonEmptyLine() public static method

public static FirstNonEmptyLine ( this str ) : string
str this
return string

FirstUpper() public static method

public static FirstUpper ( this str ) : string
str this
return string

FormatWith() public static method

public static FormatWith ( this pattern ) : string
pattern this
return string

FormatWith() public static method

public static FormatWith ( this format, IFormatProvider provider ) : string
format this
provider IFormatProvider
return string

FormatWith() public static method

public static FormatWith ( this format, object arg0 ) : string
format this
arg0 object
return string

FormatWith() public static method

public static FormatWith ( this format, object arg0, object arg1 ) : string
format this
arg0 object
arg1 object
return string

FormatWith() public static method

public static FormatWith ( this format, object arg0, object arg1, object arg2 ) : string
format this
arg0 object
arg1 object
arg2 object
return string

Indent() public static method

public static Indent ( this str, int numChars ) : string
str this
numChars int
return string

Indent() public static method

public static Indent ( this str, int numChars, char indentChar ) : string
str this
numChars int
indentChar char
return string

Like() public static method

public static Like ( this str, string pattern ) : bool
str this
pattern string
return bool

Lines() public static method

public static Lines ( this str ) : string[]
str this
return string[]

PadChopLeft() public static method

public static PadChopLeft ( this str, int length ) : string
str this
length int
return string

PadChopRight() public static method

public static PadChopRight ( this str, int length ) : string
str this
length int
return string

RemoveChars() public static method

public static RemoveChars ( this str ) : string
str this
return string

RemoveDiacritics() public static method

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

RemoveEnd() public static method

public static RemoveEnd ( this str, int numChars ) : string
str this
numChars int
return string

RemoveStart() public static method

public static RemoveStart ( this str, int numChars ) : string
str this
numChars int
return string

Replace() public static method

public static Replace ( this str, char>.Dictionary replacements ) : string
str this
replacements char>.Dictionary
return string

Replace() public static method

public static Replace ( this str, string>.Dictionary replacements ) : string
str this
replacements string>.Dictionary
return string

Replicate() public static method

public static Replicate ( this str, int times ) : string
str this
times int
return string

Reverse() public static method

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

SplitInGroupsOf() public static method

public static SplitInGroupsOf ( this str, int maxChars ) : List
str this
maxChars int
return List

SplitNoEmpty() public static method

public static SplitNoEmpty ( this text ) : string[]
text this
return string[]

SplitNoEmpty() public static method

public static SplitNoEmpty ( this text, char separator ) : string[]
text this
separator char
return string[]

SplitNoEmpty() public static method

public static SplitNoEmpty ( this text, string separator ) : string[]
text this
separator string
return string[]

Start() public static method

public static Start ( this str, int numChars ) : string
str this
numChars int
return string

ToComputerSize() public static method

public static ToComputerSize ( this value ) : string
value this
return string

ToComputerSize() public static method

public static ToComputerSize ( this value, bool useAbbreviations ) : string
value this
useAbbreviations bool
return string

TryAfter() public static method

get the substring after the first occurence of the separator
public static TryAfter ( this str, char separator ) : string
str this
separator char
return string

TryAfter() public static method

get the substring after the first occurence of the separator
public static TryAfter ( this str, string separator ) : string
str this
separator string
return string

TryAfterLast() public static method

get the substring after the last occurence of the separator
public static TryAfterLast ( this str, char separator ) : string
str this
separator char
return string

TryAfterLast() public static method

get the substring after the last occurence of the separator
public static TryAfterLast ( this str, string separator ) : string
str this
separator string
return string

TryBefore() public static method

get the substring before the first occurence of the separator
public static TryBefore ( this str, char separator ) : string
str this
separator char
return string

TryBefore() public static method

get the substring before the first occurence of the separator
public static TryBefore ( this str, string separator ) : string
str this
separator string
return string

TryBeforeLast() public static method

get the substring before the last occurence of the separator
public static TryBeforeLast ( this str, char separator ) : string
str this
separator char
return string

TryBeforeLast() public static method

get the substring before the last occurence of the separator
public static TryBeforeLast ( this str, string separator ) : string
str this
separator string
return string

TryBetween() public static method

public static TryBetween ( this str, char firstSeparator, char secondSeparator = (char)0 ) : string
str this
firstSeparator char
secondSeparator char
return string

TryBetween() public static method

public static TryBetween ( this str, string firstSeparator, string secondSeparator = null ) : string
str this
firstSeparator string
secondSeparator string
return string

TryEnd() public static method

public static TryEnd ( this str, int numChars ) : string
str this
numChars int
return string

TryRemoveEnd() public static method

public static TryRemoveEnd ( this str, int numChars ) : string
str this
numChars int
return string

TryRemoveStart() public static method

public static TryRemoveStart ( this str, int numChars ) : string
str this
numChars int
return string

TryStart() public static method

public static TryStart ( this str, int numChars ) : string
str this
numChars int
return string

VerticalEtc() public static method

public static VerticalEtc ( this str, int maxLines, string etcString = "(...)" ) : string
str this
maxLines int
etcString string
return string

Wildcards() public static method

public static Wildcards ( this fileName, IEnumerable wildcards ) : bool
fileName this
wildcards IEnumerable
return bool

Wildcards() public static method

public static Wildcards ( this fileName, string wildcard ) : bool
fileName this
wildcard string
return bool