String helper. More...
Static Public Member Functions | |||
static string | Concat (string str1, string str2) | ||
Concat two strings. More... | |||
static bool | IsValidEmailAddress (string mail) | ||
Check if the given string is a valid email address. More... | |||
static bool | IsDate (string sDate) | ||
Check is the given string matches a valid date. More... | |||
static bool | IsDouble (string chaine) | ||
Check if the string matches a double value. More... | |||
static bool | IsInteger (string chaine) | ||
Check if the string matches a int value. More... | |||
static char | CharAt (string str, int position) | ||
Return the char at the given position from the given string. More... | |||
static int | CompareTo (string str1, string str2) | ||
Compares two strings lexicographically. More... | |||
static int | CompareToIgnoreCase (string str1, string str2) | ||
Compares two strings lexicographically, ignoring case differences. More... | |||
static byte[] | GetBytes (string str) | ||
Encodes this string into a sequence of bytes using the named charset, storing the result into a new byte array. More... | |||
static int | Length (string str) | ||
Return the length of the given string. More... | |||
static bool | Matches (string str, string regexp) | ||
Check if the givenstring matches the given regex. More... | |||
static string | Replace (string str, char oldChar, char newChar) | ||
Replace every occurrence of the given character by the new one, in the given string. More... | |||
static string | Replace (string str, string searchstring, string replacement) | ||
Replace every occurence of a given searched string by the replacement one, in the given string. More... | |||
static string | ReplaceAll (string str, string regex, string replacement) | ||
Replace every occurence of the given string matching the given regex, by the replacement string. More... | |||
static string | ReplaceFirst (string str, string regex, string replacement) | ||
Replace the first occurence of the given string matching the given regex, by the replacement string. More... | |||
static string[] | Split (string str, string regex) | ||
Split the given string at avery occurence of given regex and return an array of splitted strings. More... | |||
static char[] | ToCharArray (string str) | ||
Return an array of character represention of the given string. More... | |||
static string | ConvertIntegerTostring (int?input, int?size) | ||
Convert the given int to string of the given size. More... | |||
static string | ConvertIntegerTostring (int?input) | ||
Convert the given int to string. More... | |||
static bool | IsEmpty (string str) | ||
Check if the given string is empty. More... | |||
static bool | IsNotEmpty (string str) | ||
Check if the given string is not empty. More... | |||
static bool | IsBlank (string str) | ||
Check if the given string is blank. More... | |||
static bool | IsNotBlank (string str) | ||
Check if the given string is not blank. More... | |||
static string | Trim (string str) | ||
Trim the string. More... | |||
static string | Strip (string str) | ||
Strip the string. More... | |||
static bool | AreEqual (string str1, string str2) | ||
Check if the given strings are equal. More... | |||
static bool | EqualsIgnoreCase (string str1, string str2) | ||
Check if the given strings are equal, ignoring case. More... | |||
static int | IndexOf (string str, char searchChar) | ||
Return the index of the first occurence of the given character in the given string. More... | |||
static int | LastIndexOf (string str, char searchChar) | ||
Return the index of the last occurence of the given character in the given string. More... | |||
static bool | Contains (string str, char searchChar) | ||
Check if the given string contains the given character. More... | |||
static bool | Contains (string str, string searchStr) | ||
Check if the given string contains the given search string. More... | |||
static string | Substring (string str, int start) | ||
Substring the given string from the given start position. More... | |||
static string | Substring (string str, int start, int length) | ||
Substring the given string from the given start position to position plus the given lenght. More... | |||
static string | Chomp (string str) | ||
Chomp the string. More... | |||
static string | Chop (string str) | ||
Chop the string. More... | |||
static string | Repeat (string str, int repeat) | ||
Return a string made of the given string repeated n times. More... | |||
static string | UpperCase (string str) | ||
| |||
static string | LowerCase (string str) | ||
Return the given string with lower case charaters only. More... | |||
static bool | IsAlpha (string str) | ||
Check if the given string only contains unicode letters. More... | |||
static bool | IsAlphaSpace (string str) | ||
Check if the given string only contains letters. More... | |||
static bool | IsAlphanumeric (string str) | ||
Check if the given string only contains letters or digits. More... | |||
static bool | IsAlphanumericSpace (string str) | ||
Check if the given string only contains letters, digits or spaces. More... | |||
static bool | IsNumeric (string str) | ||
Check if the given string only contains digits. More... | |||
static bool | IsNumericSpace (string str) | ||
Check if the given string only contains digits or spaces. More... | |||
static bool | IsWhitespace (string str) | ||
Check if the given string only contains whitespaces. More... | |||
static string | Reverse (string str) | ||
Reverse the given string. More... | |||
static string | StripEnd (string str, string stripChars) | ||
Strip the given string. More... | |||
static string | Format (string format, object[] argument) | ||
Returns a formatted string using the specified format string, and arguments. More... | |||
static string | SubstringBefore (string str, string separator) | ||
Gets the substring before the first occurrence of a separator. The separator is not returned. More... | |||
static string | SubstringAfter (string str, string separator) | ||
Gets the substring after the first occurrence of a separator. The separator is not returned. More... | |||
Static Public Attributes | |
static readonly string | STANDARD_DATE_FORMAT = "dd/MM/yyyy" |
STANDARD_DATE_FORMAT. | |
static readonly string | NO_SEPARATOR_SHORT_DATE_FORMAT = "ddMMyy" |
NO_SEPARATOR_SHORT_DATE_FORMAT. | |
static readonly string | LIBELLE_DATE_FORMAT = "dd MMMMMMMMM yyyy" |
LIBELLE_DATE_FORMAT. | |
static readonly string | UNDERSCORE_DATE_FORMAT = "dd_MM_yyyy" |
UNDERSCORE_DATE_FORMAT. | |
static readonly string | TIRET_DATE_FORMAT = "dd-MM-yyyy" |
TIRET_DATE_FORMAT. | |
static readonly string | STANDARD_HOUR_DATE_FORMAT = "dd/MM/yyyy HH:mm" |
STANDARD_HOUR_DATE_FORMAT. | |
static readonly string | STANDARD_HOUR_DATE_FORMAT_LETTRE = "dd/MM/yyyy HH'h'mm" |
STANDARD_HOUR_DATE_FORMAT_LETTRE. | |
static readonly string | STANDARD_HOUR_DATE_FORMAT_FILE = "dd_MM_yyyy_HH'h'mm'm'ss" |
STANDARD_HOUR_DATE_FORMAT_FILE. | |
Detailed Description
String helper.
Member Function Documentation
|
static |
Check if the given strings are equal.
- Parameters
-
str1 string str2 string
- Returns
- true if the strings are equal, case sensitive, or both null.
|
static |
Return the char at the given position from the given string.
- Parameters
-
str string position int
- Returns
- the character at the specified index of this string. The first character is at index 0.
|
static |
Chomp the string.
- Parameters
-
str string
- Returns
- string without newline, null if null string input.
|
static |
Chop the string.
- Parameters
-
str string
- Returns
- string without last character, null if null string input.
|
static |
Compares two strings lexicographically.
- Parameters
-
str1 string str2 string
- Returns
- the value 0 if the argument str2 is equal to str1; a value less than 0 if str1 is lexicographically less than str2; and a value greater than 0 if str1 is lexicographically greater than str2.
|
static |
Compares two strings lexicographically, ignoring case differences.
- Parameters
-
str1 string str2 string
- Returns
- the value 0 if the argument str2 is equal to str1; a value less than 0 if str1 is lexicographically less than str2; and a value greater than 0 if str1 is lexicographically greater than str2.
|
static |
Concat two strings.
- Parameters
-
str1 string str2 string
- Returns
- the string that is a concatenation of str1 and str2, handling null parameters ("abc"+null="abc").
|
static |
Check if the given string contains the given character.
- Parameters
-
str string searchChar char
- Returns
- true if the string contains the search character, false if not or null string input.
|
static |
Check if the given string contains the given search string.
- Parameters
-
str string searchStr string
- Returns
- true if the string contains the search string, false if not or null string input.
|
static |
Convert the given int to string of the given size.
- Parameters
-
input int? size int?
- Returns
- if size is not nul a new string left padded with zeros until the size of the crafted string is e, if size is null the tostring value.
|
static |
Convert the given int to string.
- Parameters
-
input int?
- Returns
- the tostring value of the Integer parameter if not null, "" otherwise.
|
static |
Check if the given strings are equal, ignoring case.
- Parameters
-
str1 string str2 string
- Returns
- true if the strings are equal, case insensitive, or both null.
|
static |
Returns a formatted string using the specified format string, and arguments.
- Parameters
-
format string argument object
- Returns
- A formatted string.
|
static |
Encodes this string into a sequence of bytes using the named charset, storing the result into a new byte array.
- Parameters
-
str string
- Returns
- the resultant byte array.
|
static |
Return the index of the first occurence of the given character in the given string.
- Parameters
-
str string searchChar char
- Returns
- the first index of the search character, -1 if no match or null string input.
|
static |
Check if the given string only contains unicode letters.
- Parameters
-
str string
str string
- Returns
- true if the string only contains unicode letters.
|
static |
Check if the given string only contains letters or digits.
- Parameters
-
str string
- Returns
- true if only contains letters or digits, and is non-null.
|
static |
Check if the given string only contains letters, digits or spaces.
- Parameters
-
str string
- Returns
- true if only contains letters, digits or spaces, and is non-null.
|
static |
Check if the given string only contains letters.
- Parameters
-
str string
- Returns
- true if only contains letters, and is non-null.
|
static |
Check if the given string is blank.
- Parameters
-
str string
- Returns
- true if the string is null, empty or whitespace.
|
static |
Check is the given string matches a valid date.
- Parameters
-
sDate string
- Returns
- true if string matches "dd/MM/yyyy" and is a valid date (ex : 31/02/2012 forbidden).
|
static |
Check if the string matches a double value.
- Parameters
-
chaine string
- Returns
- true if string matches a double value.
|
static |
Check if the given string is empty.
- Parameters
-
str string
- Returns
- true if the string is empty or null.
|
static |
Check if the string matches a int value.
- Parameters
-
chaine string
- Returns
- true if string matches an int value.
|
static |
Check if the given string is not blank.
- Parameters
-
str string
- Returns
- true if the string is not null, not empty and not whitespace.
|
static |
Check if the given string is not empty.
- Parameters
-
str string
- Returns
- true if the string is not empty and not null.
|
static |
Check if the given string only contains digits.
- Parameters
-
str string
- Returns
- true if only contains digits, and is non-null.
|
static |
Check if the given string only contains digits or spaces.
- Parameters
-
str string
- Returns
- true if only contains digits or spaces, and is non-null.
|
static |
Check if the given string is a valid email address.
- Parameters
-
mail string
- Returns
- true if string matches format XX@XX. .XX
|
static |
Check if the given string only contains whitespaces.
- Parameters
-
str string
- Returns
- true if only contains whitespaces, and is non-null.
|
static |
Return the index of the last occurence of the given character in the given string.
- Parameters
-
str string searchChar char
- Returns
- the last index of the search character, -1 if no match or null string input.
|
static |
Return the length of the given string.
- Parameters
-
str string
- Returns
- the length of this string.
|
static |
Return the given string with lower case charaters only.
- Parameters
-
str string
- Returns
- the lower cased string, null if null string input.
|
static |
Check if the givenstring matches the given regex.
- Parameters
-
str string regexp string
- Returns
- true if str matches regexp. Otherwise false.
|
static |
Return a string made of the given string repeated n times.
- Parameters
-
str string repeat int
- Returns
- a new string consisting of the original string repeated n times, null if null string input.
|
static |
Replace every occurrence of the given character by the new one, in the given string.
- Parameters
-
str string oldChar char newChar char
- Returns
- a string derived from this string by replacing every occurrence of oldChar with newChar.
|
static |
Replace every occurence of a given searched string by the replacement one, in the given string.
- Parameters
-
str string searchstring string replacement string
- Returns
- the string with any replacements processed, null if null string input.
|
static |
Replace every occurence of the given string matching the given regex, by the replacement string.
- Parameters
-
str string regex string replacement string
- Returns
- a string derived from this string by replacing every occurrence of regexp with replacement parameter.
|
static |
Replace the first occurence of the given string matching the given regex, by the replacement string.
- Parameters
-
str str regex regex replacement replacement
- Returns
- a string derived from this string by replacing the first occurrence of regexp with replacement parameter.
|
static |
Reverse the given string.
- Parameters
-
str string
- Returns
- the reversed string, null if null string input.
|
static |
Split the given string at avery occurence of given regex and return an array of splitted strings.
- Parameters
-
str str regex regex
- Returns
- the array of strings computed by splitting this string around matches of the given regular expression.
|
static |
Strip the string.
- Parameters
-
str string
- Returns
- the stripped string, null if null string input.
|
static |
Strip the given string.
- Parameters
-
str string stripChars string
- Returns
- the stripped string,
null
if null string input.
|
static |
Substring the given string from the given start position.
- Parameters
-
str string start int
- Returns
- substring from start position, null if null string input. A negative start position can be used to start n characters from the end of the string.
|
static |
Substring the given string from the given start position to position plus the given lenght.
- Parameters
-
str string start int length int
- Returns
- substring from start position to start position plus length, null if null string input.
|
static |
Gets the substring after the first occurrence of a separator. The separator is not returned.
- Parameters
-
str string separator string
- Returns
- the substring after the first occurrence of the separator, null if null string input.
|
static |
Gets the substring before the first occurrence of a separator. The separator is not returned.
- Parameters
-
str string separator string
- Returns
- the substring before the first occurrence of the separator, null if null string input.
|
static |
Return an array of character represention of the given string.
- Parameters
-
str string
- Returns
- a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
|
static |
Trim the string.
- Parameters
-
str string
- Returns
- the trimmed string, null if null string input.
|
static |
- Parameters
-
str string
- Returns
- the upper cased string, null if null string input.
The documentation for this class was generated from the following file:
- Summer.Batch.Extra/Utils/StringUtils.cs