Exemple #1
0
 public static string GetRandomLine(string text)
 {
     string[] lines = text.Trim().Lines();
     if (lines != null && lines.Length > 0)
     {
         return(lines[MathHelpers.CryptoRandom(0, lines.Length - 1)]);
     }
     return(null);
 }
Exemple #2
0
 public static char GetRandomChar(string chars)
 {
     return(chars[MathHelpers.CryptoRandom(chars.Length - 1)]);
 }