Summer.Batch.Common.Util.StringUtils Class Reference

Class providing utility methods on character strings. More...

Static Public Member Functions

static int CountOccurrencesOf (string str, string sub)
 Counts the occurrences of a substring in a string. More...
 
static bool EndsWithIgnoreCase (string str, string suffix)
 Checks if a string ends with a specified suffix, ignoring case. More...
 
static string ReplaceFirst (string text, string regex, string replace)
 Replaces the first occurences of a regular expression. More...
 
static string ToDelimitedString< T > (this IEnumerable< T > enumerable, string delimiter)
 Aggregates elements into a string using a delimiter. More...
 

Detailed Description

Class providing utility methods on character strings.

Member Function Documentation

static int Summer.Batch.Common.Util.StringUtils.CountOccurrencesOf ( string  str,
string  sub 
)
static

Counts the occurrences of a substring in a string.

Parameters
strThe string to search.
subThe substring to search for.
Returns
The number of occurrences of sub in str ; 0 if either is null.
static bool Summer.Batch.Common.Util.StringUtils.EndsWithIgnoreCase ( string  str,
string  suffix 
)
static

Checks if a string ends with a specified suffix, ignoring case.

Parameters
strThe string to search.
suffixThe suffix to search for.
Returns
Whether str ends with suffix .
static string Summer.Batch.Common.Util.StringUtils.ReplaceFirst ( string  text,
string  regex,
string  replace 
)
static

Replaces the first occurences of a regular expression.

Parameters
textThe string to search.
regexThe regular expression to search for.
replaceThe replacing text.
Returns
The transformed string.
static string Summer.Batch.Common.Util.StringUtils.ToDelimitedString< T > ( this IEnumerable< T >  enumerable,
string  delimiter 
)
static

Aggregates elements into a string using a delimiter.

Template Parameters
T the type of the elements to aggregate
Parameters
enumerablethe enumerable containing the elements to aggregate
delimiterthe delimiter to use
Returns
a string containing the elements of enumerable separated by the delimiter

The documentation for this class was generated from the following file:
  • Summer.Batch.Common/Util/StringUtils.cs