Random generator for string values.
More...
|
static char | Pick (string values) |
| Picks a random character from a string. More...
|
|
static string | Pick (String[] values) |
| Picks a random character from an array of string.. More...
|
|
static string | Distort (string value) |
| Distorts a string by randomly replacing characters in it. More...
|
|
static char | NextAlphaChar () |
| Generates random alpha characted [A-Za-z] More...
|
|
static string | NextString (int minLength, int maxLength) |
| Generates a random string, consisting of upper and lower case letters (of the English alphabet), digits(0-9), and symbols("_,.:-/.[].{},#-!,$=%.+^.&*-() "). More...
|
|
|
static readonly string | _digits = "01234956789" |
|
static readonly string | _symbols = "_,.:-/.[].{},#-!,$=%.+^.&*-() " |
|
static readonly string | _alphaLower = "abcdefghijklmnopqrstuvwxyz" |
|
static readonly string | _alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
|
static readonly string | _alpha = _alphaUpper + _alphaLower |
|
static readonly string | _chars = _alpha + _digits + _symbols |
|
Random generator for string values.
var value1 = RandomString.Pick("ABC");
var value2 = RandomString.Pick(new String {"A","B","C"});
◆ Distort()
static string PipServices3.Commons.Random.RandomString.Distort |
( |
string |
value | ) |
|
|
static |
Distorts a string by randomly replacing characters in it.
- Parameters
-
value | a string to distort. |
- Returns
- a distored string.
◆ NextAlphaChar()
static char PipServices3.Commons.Random.RandomString.NextAlphaChar |
( |
| ) |
|
|
static |
Generates random alpha characted [A-Za-z]
- Returns
- a random characted.
◆ NextString()
static string PipServices3.Commons.Random.RandomString.NextString |
( |
int |
minLength, |
|
|
int |
maxLength |
|
) |
| |
|
static |
Generates a random string, consisting of upper and lower case letters (of the English alphabet), digits(0-9), and symbols("_,.:-/.[].{},#-!,$=%.+^.&*-() ").
- Parameters
-
minLength | (optional) minimum string length. |
maxLength | maximum string length. |
- Returns
- a random string.
◆ Pick() [1/2]
static char PipServices3.Commons.Random.RandomString.Pick |
( |
string |
values | ) |
|
|
static |
Picks a random character from a string.
- Parameters
-
values | a string to pick a char from |
- Returns
- a randomly picked char.
◆ Pick() [2/2]
static string PipServices3.Commons.Random.RandomString.Pick |
( |
String [] |
values | ) |
|
|
static |
Picks a random character from an array of string..
- Parameters
-
values | a string to pick from |
- Returns
- a randomly picked string.
The documentation for this class was generated from the following file:
- src/Random/RandomString.cs