UtilStringRandomReplaceLetterOrDigit Method

Replaces a letter or digit character with a random character of the same type based on these specific rules:

● If the character is a digit ( Char.IsDigit(character) ), the function returns a different digit from the range "0" to "9".

● If the character is a letter ( Char.IsLetter(character) ):

- If it is a vowel, and it is upper-case, the function returns a different upper-case vowel.

- If it is a vowel, and it is lower-case, the function returns a different lower-case vowel.

- If it is a consonant, and it is upper-case, the function returns a different upper-case consonant.

- If it is a consonant, and it is lower-case, the function returns a different lower-case consonant.

● If the character is neither a letter nor a digit, the function returns the same character.

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 char RandomReplaceLetterOrDigit(
	char character
)

Parameters

character  Char
The character to be replaced.

Return Value

Char
If the character is a letter or digit, returns a random character of the same type; otherwise, returns the same character.

See Also