C# Class Summer.Batch.Extra.Utils.StringUtils

String helper.
Afficher le fichier Open project: SummerBatch/SummerBatch

Méthodes publiques

Свойство Type Description
LIBELLE_DATE_FORMAT string
NO_SEPARATOR_SHORT_DATE_FORMAT string
STANDARD_DATE_FORMAT string
STANDARD_HOUR_DATE_FORMAT string
STANDARD_HOUR_DATE_FORMAT_FILE string
STANDARD_HOUR_DATE_FORMAT_LETTRE string
TIRET_DATE_FORMAT string
UNDERSCORE_DATE_FORMAT string

Méthodes publiques

Méthode Description
AreEqual ( string str1, string str2 ) : bool

Check if the given strings are equal.

CharAt ( string str, int position ) : char

Return the char at the given position from the given string.

Chomp ( string str ) : string

Chomp the string.

Chop ( string str ) : string

Chop the string.

CompareTo ( string str1, string str2 ) : int

Compares two strings lexicographically.

CompareToIgnoreCase ( string str1, string str2 ) : int

Compares two strings lexicographically, ignoring case differences.

Concat ( string str1, string str2 ) : string

Concat two strings.

Contains ( string str, char searchChar ) : bool

Check if the given string contains the given character.

Contains ( string str, string searchStr ) : bool

Check if the given string contains the given search string.

ConvertIntegerTostring ( int input ) : string

Convert the given int to string.

ConvertIntegerTostring ( int input, int size ) : string

Convert the given int to string of the given size.

EqualsIgnoreCase ( string str1, string str2 ) : bool

Check if the given strings are equal, ignoring case.

Format ( string format, object argument ) : string

Returns a formatted string using the specified format string, and arguments.

GetBytes ( string str ) : byte[]

Encodes this string into a sequence of bytes using the named charset, storing the result into a new byte array.

IndexOf ( string str, char searchChar ) : int

Return the index of the first occurence of the given character in the given string.

IsAlpha ( string str ) : bool

Check if the given string only contains unicode letters.

IsAlphaSpace ( string str ) : bool

Check if the given string only contains letters.

IsAlphanumeric ( string str ) : bool

Check if the given string only contains letters or digits.

IsAlphanumericSpace ( string str ) : bool

Check if the given string only contains letters, digits or spaces.

IsBlank ( string str ) : bool

Check if the given string is blank.

IsDate ( string sDate ) : bool

Check is the given string matches a valid date.

IsDouble ( string chaine ) : bool

Check if the string matches a double value.

IsEmpty ( string str ) : bool

Check if the given string is empty.

IsInteger ( string chaine ) : bool

Check if the string matches a int value.

IsNotBlank ( string str ) : bool

Check if the given string is not blank.

IsNotEmpty ( string str ) : bool

Check if the given string is not empty.

IsNumeric ( string str ) : bool

Check if the given string only contains digits.

IsNumericSpace ( string str ) : bool

Check if the given string only contains digits or spaces.

IsValidEmailAddress ( string mail ) : bool

Check if the given string is a valid email address.

IsWhitespace ( string str ) : bool

Check if the given string only contains whitespaces.

LastIndexOf ( string str, char searchChar ) : int

Return the index of the last occurence of the given character in the given string.

Length ( string str ) : int

Return the length of the given string.

LowerCase ( string str ) : string

Return the given string with lower case charaters only.

Matches ( string str, string regexp ) : bool

Check if the givenstring matches the given regex.

Repeat ( string str, int repeat ) : string

Return a string made of the given string repeated n times.

Replace ( string str, char oldChar, char newChar ) : string

Replace every occurrence of the given character by the new one, in the given string.

Replace ( string str, string searchstring, string replacement ) : string

Replace every occurence of a given searched string by the replacement one, in the given string.

ReplaceAll ( string str, string regex, string replacement ) : string

Replace every occurence of the given string matching the given regex, by the replacement string.

ReplaceFirst ( string str, string regex, string replacement ) : string

Replace the first occurence of the given string matching the given regex, by the replacement string.

Reverse ( string str ) : string

Reverse the given string.

Split ( string str, string regex ) : string[]

Split the given string at avery occurence of given regex and return an array of splitted strings.

Strip ( string str ) : string

Strip the string.

StripEnd ( string str, string stripChars ) : string

Strip the given string.

Substring ( string str, int start ) : string

Substring the given string from the given start position.

Substring ( string str, int start, int length ) : string

Substring the given string from the given start position to position plus the given lenght.

SubstringAfter ( string str, string separator ) : string

Gets the substring after the first occurrence of a separator. The separator is not returned.

SubstringBefore ( string str, string separator ) : string

Gets the substring before the first occurrence of a separator. The separator is not returned.

ToCharArray ( string str ) : char[]

Return an array of character represention of the given string.

Trim ( string str ) : string

Trim the string.

UpperCase ( string str ) : string

string the upper cased string, null if null string input.

Method Details

AreEqual() public static méthode

Check if the given strings are equal.
public static AreEqual ( string str1, string str2 ) : bool
str1 string string
str2 string string
Résultat bool

CharAt() public static méthode

Return the char at the given position from the given string.
public static CharAt ( string str, int position ) : char
str string string
position int int
Résultat char

Chomp() public static méthode

Chomp the string.
public static Chomp ( string str ) : string
str string string
Résultat string

Chop() public static méthode

Chop the string.
public static Chop ( string str ) : string
str string string
Résultat string

CompareTo() public static méthode

Compares two strings lexicographically.
public static CompareTo ( string str1, string str2 ) : int
str1 string string
str2 string string
Résultat int

CompareToIgnoreCase() public static méthode

Compares two strings lexicographically, ignoring case differences.
public static CompareToIgnoreCase ( string str1, string str2 ) : int
str1 string string
str2 string string
Résultat int

Concat() public static méthode

Concat two strings.
public static Concat ( string str1, string str2 ) : string
str1 string string
str2 string string
Résultat string

Contains() public static méthode

Check if the given string contains the given character.
public static Contains ( string str, char searchChar ) : bool
str string string
searchChar char char
Résultat bool

Contains() public static méthode

Check if the given string contains the given search string.
public static Contains ( string str, string searchStr ) : bool
str string string
searchStr string string
Résultat bool

ConvertIntegerTostring() public static méthode

Convert the given int to string.
public static ConvertIntegerTostring ( int input ) : string
input int int?
Résultat string

ConvertIntegerTostring() public static méthode

Convert the given int to string of the given size.
public static ConvertIntegerTostring ( int input, int size ) : string
input int int?
size int int?
Résultat string

EqualsIgnoreCase() public static méthode

Check if the given strings are equal, ignoring case.
public static EqualsIgnoreCase ( string str1, string str2 ) : bool
str1 string string
str2 string string
Résultat bool

Format() public static méthode

Returns a formatted string using the specified format string, and arguments.
public static Format ( string format, object argument ) : string
format string string
argument object object
Résultat string

GetBytes() public static méthode

Encodes this string into a sequence of bytes using the named charset, storing the result into a new byte array.
public static GetBytes ( string str ) : byte[]
str string string
Résultat byte[]

IndexOf() public static méthode

Return the index of the first occurence of the given character in the given string.
public static IndexOf ( string str, char searchChar ) : int
str string string
searchChar char char
Résultat int

IsAlpha() public static méthode

Check if the given string only contains unicode letters.
public static IsAlpha ( string str ) : bool
str string string
Résultat bool

IsAlphaSpace() public static méthode

Check if the given string only contains letters.
public static IsAlphaSpace ( string str ) : bool
str string string
Résultat bool

IsAlphanumeric() public static méthode

Check if the given string only contains letters or digits.
public static IsAlphanumeric ( string str ) : bool
str string string
Résultat bool

IsAlphanumericSpace() public static méthode

Check if the given string only contains letters, digits or spaces.
public static IsAlphanumericSpace ( string str ) : bool
str string string
Résultat bool

IsBlank() public static méthode

Check if the given string is blank.
public static IsBlank ( string str ) : bool
str string string
Résultat bool

IsDate() public static méthode

Check is the given string matches a valid date.
public static IsDate ( string sDate ) : bool
sDate string string
Résultat bool

IsDouble() public static méthode

Check if the string matches a double value.
public static IsDouble ( string chaine ) : bool
chaine string string
Résultat bool

IsEmpty() public static méthode

Check if the given string is empty.
public static IsEmpty ( string str ) : bool
str string string
Résultat bool

IsInteger() public static méthode

Check if the string matches a int value.
public static IsInteger ( string chaine ) : bool
chaine string string
Résultat bool

IsNotBlank() public static méthode

Check if the given string is not blank.
public static IsNotBlank ( string str ) : bool
str string string
Résultat bool

IsNotEmpty() public static méthode

Check if the given string is not empty.
public static IsNotEmpty ( string str ) : bool
str string string
Résultat bool

IsNumeric() public static méthode

Check if the given string only contains digits.
public static IsNumeric ( string str ) : bool
str string string
Résultat bool

IsNumericSpace() public static méthode

Check if the given string only contains digits or spaces.
public static IsNumericSpace ( string str ) : bool
str string string
Résultat bool

IsValidEmailAddress() public static méthode

Check if the given string is a valid email address.
public static IsValidEmailAddress ( string mail ) : bool
mail string string
Résultat bool

IsWhitespace() public static méthode

Check if the given string only contains whitespaces.
public static IsWhitespace ( string str ) : bool
str string string
Résultat bool

LastIndexOf() public static méthode

Return the index of the last occurence of the given character in the given string.
public static LastIndexOf ( string str, char searchChar ) : int
str string string
searchChar char char
Résultat int

Length() public static méthode

Return the length of the given string.
public static Length ( string str ) : int
str string string
Résultat int

LowerCase() public static méthode

Return the given string with lower case charaters only.
public static LowerCase ( string str ) : string
str string string
Résultat string

Matches() public static méthode

Check if the givenstring matches the given regex.
public static Matches ( string str, string regexp ) : bool
str string string
regexp string string
Résultat bool

Repeat() public static méthode

Return a string made of the given string repeated n times.
public static Repeat ( string str, int repeat ) : string
str string string
repeat int int
Résultat string

Replace() public static méthode

Replace every occurrence of the given character by the new one, in the given string.
public static Replace ( string str, char oldChar, char newChar ) : string
str string string
oldChar char char
newChar char char
Résultat string

Replace() public static méthode

Replace every occurence of a given searched string by the replacement one, in the given string.
public static Replace ( string str, string searchstring, string replacement ) : string
str string string
searchstring string string
replacement string string
Résultat string

ReplaceAll() public static méthode

Replace every occurence of the given string matching the given regex, by the replacement string.
public static ReplaceAll ( string str, string regex, string replacement ) : string
str string string
regex string string
replacement string string
Résultat string

ReplaceFirst() public static méthode

Replace the first occurence of the given string matching the given regex, by the replacement string.
public static ReplaceFirst ( string str, string regex, string replacement ) : string
str string str
regex string regex
replacement string replacement
Résultat string

Reverse() public static méthode

Reverse the given string.
public static Reverse ( string str ) : string
str string string
Résultat string

Split() public static méthode

Split the given string at avery occurence of given regex and return an array of splitted strings.
public static Split ( string str, string regex ) : string[]
str string str
regex string regex
Résultat string[]

Strip() public static méthode

Strip the string.
public static Strip ( string str ) : string
str string string
Résultat string

StripEnd() public static méthode

Strip the given string.
public static StripEnd ( string str, string stripChars ) : string
str string string
stripChars string string
Résultat string

Substring() public static méthode

Substring the given string from the given start position.
public static Substring ( string str, int start ) : string
str string string
start int int
Résultat string

Substring() public static méthode

Substring the given string from the given start position to position plus the given lenght.
public static Substring ( string str, int start, int length ) : string
str string string
start int int
length int int
Résultat string

SubstringAfter() public static méthode

Gets the substring after the first occurrence of a separator. The separator is not returned.
public static SubstringAfter ( string str, string separator ) : string
str string string
separator string string
Résultat string

SubstringBefore() public static méthode

Gets the substring before the first occurrence of a separator. The separator is not returned.
public static SubstringBefore ( string str, string separator ) : string
str string string
separator string string
Résultat string

ToCharArray() public static méthode

Return an array of character represention of the given string.
public static ToCharArray ( string str ) : char[]
str string string
Résultat char[]

Trim() public static méthode

Trim the string.
public static Trim ( string str ) : string
str string string
Résultat string

UpperCase() public static méthode

string the upper cased string, null if null string input.
public static UpperCase ( string str ) : string
str string
Résultat string

Property Details

LIBELLE_DATE_FORMAT public_oe static_oe property

public static string LIBELLE_DATE_FORMAT
Résultat string

NO_SEPARATOR_SHORT_DATE_FORMAT public_oe static_oe property

public static string NO_SEPARATOR_SHORT_DATE_FORMAT
Résultat string

STANDARD_DATE_FORMAT public_oe static_oe property

public static string STANDARD_DATE_FORMAT
Résultat string

STANDARD_HOUR_DATE_FORMAT public_oe static_oe property

public static string STANDARD_HOUR_DATE_FORMAT
Résultat string

STANDARD_HOUR_DATE_FORMAT_FILE public_oe static_oe property

public static string STANDARD_HOUR_DATE_FORMAT_FILE
Résultat string

STANDARD_HOUR_DATE_FORMAT_LETTRE public_oe static_oe property

public static string STANDARD_HOUR_DATE_FORMAT_LETTRE
Résultat string

TIRET_DATE_FORMAT public_oe static_oe property

public static string TIRET_DATE_FORMAT
Résultat string

UNDERSCORE_DATE_FORMAT public_oe static_oe property

public static string UNDERSCORE_DATE_FORMAT
Résultat string