UtilStringWrapCharacters Method

Decorates the input string by wrapping each character with the specified decorative symbols for its left and right sides.

For example, if the input string is 'ABC', the resulting string could be similar to this: '{A}{B}{C}'.

Definition

Namespace: DevCase.Core.DataProcessing.Common
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string WrapCharacters(
	string input,
	char leftChar,
	char rightChar,
	bool surroundNonAlphanumeric = false,
	bool squishRepeatedDecorationChars = false
)

Parameters

input  String
The input string to decorate.
leftChar  Char
The character used for decorating the left side of the characters in the input string.
rightChar  Char
The character used for decorating the right side of the characters in the input string.
surroundNonAlphanumeric  Boolean  (Optional)
If true, also decorates non-alphanumeric characters.

Default value is: False.

squishRepeatedDecorationChars  Boolean  (Optional)
If true, and if leftChar and rightChar are the same characters, only draws the decorative symbol for the left side of the characters in the input string.

Default value is: False.

Return Value

String
The resulting decorated string.

See Also