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); }
public static char GetRandomChar(string chars) { return(chars[MathHelpers.CryptoRandom(chars.Length - 1)]); }