Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.ExtensionMethods.Utils Class Reference

String extension methods. More...

Static Public Member Functions

static string CaseInsenstiveReplace (this string val, char charToReplace, char replacement)
 Replaces a given character with another character in a string. The replacement is case insensitive Test Coverage: Included More...
 
static string CaseInsenstiveReplace (this string val, string stringToReplace, string replacement)
 Replaces a given string with another string in a given string. The replacement is case insensitive Test Coverage: Included More...
 
static string ReplaceFirst (this string val, string stringToReplace, string replacement)
 Replaces the first occurrence of a string with another string in a given string The replacement is case insensitive Test Coverage: Included More...
 
static string ReplaceFirst (this string val, char charToReplace, char replacement)
 Replaces the first occurrence of a character with another character in a given string The replacement is case insensitive Test Coverage: Included More...
 
static string ReplaceLast (this string val, char charToReplace, char replacement)
 Replaces the last occurrence of a character with another character in a given string The replacement is case insensitive Test Coverage: Included More...
 
static string ReplaceLast (this string val, string stringToReplace, string replacement)
 Replaces the last occurrence of a string with another string in a given string The replacement is case insensitive Test Coverage: Included More...
 
static string RemoveWords (this string val, params string[] filterWords)
 Removes occurrences of words in a string The match is case sensitive Test Coverage: Included More...
 
static string MaskWords (this string val, char mask, params string[] filterWords)
 Masks the occurence of words in a string with a given character Test Coverage: Included More...
 
static string PadLeft (this string val, string pad, int totalWidth)
 Left pads the passed string using the passed pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width. Test Coverage: Included More...
 
static string PadLeft (this string val, string pad, int totalWidth, bool cutOff)
 Left pads the passed string using the passed pad string for the total number of spaces. More...
 
static string PadRight (this string val, string pad, int totalWidth)
 Right pads the passed string using the passed pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width. Test Coverage: Included More...
 
static string PadRight (this string val, string pad, int totalWidth, bool cutOff)
 Right pads the passed string using the passed pad string for the total number of spaces. More...
 
static string RemoveNewLines (this string val)
 Removes new line characters from a string Test Coverage: Included More...
 
static string RemoveNewLines (this string input, bool addSpace)
 Removes new line characters from a string Test Coverage: Included More...
 
static string RemoveNonNumeric (this string s)
 Removes a non numeric character from a string Test Coverage: Included More...
 
static string RemoveNumeric (this string s)
 Removes numeric characters from a given string Test Coverage: Included More...
 
static string Reverse (this string val)
 Reverses a string Test Coverage: Included More...
 
static string SentenceCase (this string val)
 Changes the string as sentence case. Test Coverage: Included More...
 
static string TitleCase (this string val)
 Changes the string as title case. Ignores short words in the string. Test Coverage: Included More...
 
static string TitleCase (this string val, bool ignoreShortWords)
 Changes the string as title case. Test Coverage: Included More...
 
static string TrimIntraWords (this string val)
 Removes multiple spaces between words Test Coverage: Included More...
 
static string WordWrap (this string val, int charCount)
 Test Coverage: Included More...
 
static string WordWrap (this string val, int charCount, bool cutOff)
 Wraps the passed string at the passed total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text More...
 
static string ToCSV (this IEnumerable< string > val, bool insertSpaces)
 Converts an list of string to CSV string representation. Test Coverage: Included More...
 
static string ToCSV (this IEnumerable< char > val, bool insertSpaces)
 Converts an list of characters to CSV string representation. Test Coverage: Included More...
 
static IEnumerable< string > ListFromCSV (this string val)
 Converts CSV to list of string. Test Coverage: Included More...
 
static void Serialize (this string val, string filePath)
 Binary Serialization to a file More...
 

Detailed Description

String extension methods.

Member Function Documentation

static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.CaseInsenstiveReplace ( this string  val,
char  charToReplace,
char  replacement 
)
static

Replaces a given character with another character in a string. The replacement is case insensitive Test Coverage: Included

Parameters
val
charToReplaceThe character to replace
replacementThe character by which to be replaced
Returns
Copy of string with the characters replaced
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.CaseInsenstiveReplace ( this string  val,
string  stringToReplace,
string  replacement 
)
static

Replaces a given string with another string in a given string. The replacement is case insensitive Test Coverage: Included

Parameters
val
stringToReplaceThe string to replace
replacementThe string by which to be replaced
Returns
Copy of string with the string replaced
static IEnumerable<string> PushTechnology.DiffusionCore.ExtensionMethods.Utils.ListFromCSV ( this string  val)
static

Converts CSV to list of string. Test Coverage: Included

Parameters
val
Returns
IEnumerable collection of string
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.MaskWords ( this string  val,
char  mask,
params string[]  filterWords 
)
static

Masks the occurence of words in a string with a given character Test Coverage: Included

Parameters
val
maskThe character mask to apply
filterWordsThe words to be replaced
Returns
The copy of string with the mask applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.PadLeft ( this string  val,
string  pad,
int  totalWidth 
)
static

Left pads the passed string using the passed pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width. Test Coverage: Included

Parameters
val
padThe pad string
totalWidthThe total width of the resulting string
Returns
Copy of string with the padding applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.PadLeft ( this string  val,
string  pad,
int  totalWidth,
bool  cutOff 
)
static

Left pads the passed string using the passed pad string for the total number of spaces.

Parameters
val
padThe pad string
totalWidthThe total width of the resulting string
cutOffTrue to cut off the characters if exceeds the specified width
Returns
Copy of string with the padding applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.PadRight ( this string  val,
string  pad,
int  totalWidth 
)
static

Right pads the passed string using the passed pad string for the total number of spaces. It will not cut-off the pad even if it causes the string to exceed the total width. Test Coverage: Included

Parameters
val
padThe pad string
totalWidthThe total width of the resulting string
Returns
Copy of string with the padding applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.PadRight ( this string  val,
string  pad,
int  totalWidth,
bool  cutOff 
)
static

Right pads the passed string using the passed pad string for the total number of spaces.

Parameters
val
padThe pad string
totalWidthThe total width of the resulting string
cutOffTrue to cut off the characters if exceeds the specified width
Returns
Copy of string with the padding applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.RemoveNewLines ( this string  val)
static

Removes new line characters from a string Test Coverage: Included

Parameters
val
Returns
Returns copy of string with the new line characters removed
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.RemoveNewLines ( this string  input,
bool  addSpace 
)
static

Removes new line characters from a string Test Coverage: Included

Parameters
input
addSpaceTrue to add a space after removing a new line character
Returns
Returns a copy of the string after removing the new line character
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.RemoveNonNumeric ( this string  s)
static

Removes a non numeric character from a string Test Coverage: Included

Parameters
s
Returns
Copy of the string after removing non numeric characters
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.RemoveNumeric ( this string  s)
static

Removes numeric characters from a given string Test Coverage: Included

Parameters
s
Returns
Copy of the string after removing the numeric characters
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.RemoveWords ( this string  val,
params string[]  filterWords 
)
static

Removes occurrences of words in a string The match is case sensitive Test Coverage: Included

Parameters
val
filterWordsArray of words to be removed from the string
Returns
Copy of the string with the words removed
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ReplaceFirst ( this string  val,
string  stringToReplace,
string  replacement 
)
static

Replaces the first occurrence of a string with another string in a given string The replacement is case insensitive Test Coverage: Included

Parameters
val
stringToReplaceThe string to replace
replacementThe string by which to be replaced
Returns
Copy of string with the string replaced
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ReplaceFirst ( this string  val,
char  charToReplace,
char  replacement 
)
static

Replaces the first occurrence of a character with another character in a given string The replacement is case insensitive Test Coverage: Included

Parameters
val
charToReplaceThe character to replace
replacementThe character by which to replace
Returns
Copy of string with the character replaced
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ReplaceLast ( this string  val,
char  charToReplace,
char  replacement 
)
static

Replaces the last occurrence of a character with another character in a given string The replacement is case insensitive Test Coverage: Included

Parameters
val
charToReplaceThe character to replace
replacementThe character by which to replace
Returns
Copy of string with the character replaced
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ReplaceLast ( this string  val,
string  stringToReplace,
string  replacement 
)
static

Replaces the last occurrence of a string with another string in a given string The replacement is case insensitive Test Coverage: Included

Parameters
val
stringToReplaceThe string to replace
replacementThe string by which to be replaced
Returns
Copy of string with the string replaced
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.Reverse ( this string  val)
static

Reverses a string Test Coverage: Included

Parameters
val
Returns
Copy of the reversed string
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.SentenceCase ( this string  val)
static

Changes the string as sentence case. Test Coverage: Included

Parameters
val
Returns
Copy of string with the sentence case applied
static void PushTechnology.DiffusionCore.ExtensionMethods.Utils.Serialize ( this string  val,
string  filePath 
)
static

Binary Serialization to a file

Parameters
val
filePathThe file where serialized data has to be stored
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.TitleCase ( this string  val)
static

Changes the string as title case. Ignores short words in the string. Test Coverage: Included

Parameters
val
Returns
Copy of string with the title case applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.TitleCase ( this string  val,
bool  ignoreShortWords 
)
static

Changes the string as title case. Test Coverage: Included

Parameters
val
ignoreShortWordstrue to ignore short words
Returns
Copy of string with the title case applied
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ToCSV ( this IEnumerable< string >  val,
bool  insertSpaces 
)
static

Converts an list of string to CSV string representation. Test Coverage: Included

Parameters
val
insertSpacesTrue to add spaces after each comma
Returns
CSV representation of the data
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.ToCSV ( this IEnumerable< char >  val,
bool  insertSpaces 
)
static

Converts an list of characters to CSV string representation. Test Coverage: Included

Parameters
val
insertSpacesTrue to add spaces after each comma
Returns
CSV representation of the data
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.TrimIntraWords ( this string  val)
static

Removes multiple spaces between words Test Coverage: Included

Parameters
val
Returns
Returns a copy of the string after removing the extra spaces
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.WordWrap ( this string  val,
int  charCount 
)
static

Test Coverage: Included

Parameters
val
charCountThe number of characters after which it should wrap the text
Returns
The copy of the string after applying the Wrap
static string PushTechnology.DiffusionCore.ExtensionMethods.Utils.WordWrap ( this string  val,
int  charCount,
bool  cutOff 
)
static

Wraps the passed string at the passed total number of characters (if cuttOff is true) or at the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text

Parameters
val
charCountThe number of characters after which to break
cutOfftrue to break at specific
Returns