Bool() public static method

Gets a random boolean value
public static Bool ( ) : bool
return bool
Exemplo n.º 1
0
        /// <summary>
        /// Gets a random gender
        /// </summary>
        /// <returns>A string value</returns>
        public static string Gender()
        {
            if (Number.Bool())
            {
                return("Male");
            }

            return("Female");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a random letter
        /// </summary>
        /// <returns>A <see cref="char"/></returns>
        public static char Letter()
        {
            string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

            if (Number.Bool())
            {
                return(chars[Number.RandomNumber(0, chars.Length - 1)]);
            }

            return(char.ToLower(chars[Number.RandomNumber(0, chars.Length - 1)]));
        }