[Csharp] // Random number Random r = new Random (); while (true) {int I = r. next (1, 7); Console. writeLine (I); Console. readKey () ;}// specifies the delimiter array, returns a string str = "my name is lei"; char [] a = {''}; string [] B = str. split (a, StringSplitOptions. removeEmptyEntries); for (int I = 0; I <B. length; I ++) {Console. writeLine (B [I]);} Console. readKey (); // returns the Console in reverse order. writeLine ("enter a string"); string a = Console. readLine (); string [] d =. split (''); for (int I = d. length-1; I> = 0; I --) {Console. write (d [I] + "");} Console. readKey (); // ignore case-insensitive string a = "a"; string B = "A"; if (. equals (B, StringComparison. ordinalIgnoreCase) {Console. writeLine ("same");} else {Console. writeLine ("different");} Console. readKey (); // replace string a = "2008-11-12"; string [] B =. split ('-'); Console. writeLine ("{0}-{1}-{2}", B); Console. readKey (); // The 9 th multiplication table for (int I = 1; I <= 9; I ++) {for (int j = 1; j <= I; j ++) {Console. write ("{0} X {1} = {2: 00}", I, j, I * j);} Console. writeLine ();} Console. readKey (); // determines whether the specified substring string [] strc = {"xxoo", "TMD", "Harmony"}; string a = Console. readLine (); int I; for (I = 0; I <. length; I ++) {if (. contains (strc [I]) {break ;}} if (I <. length) {Console. writeLine ("invalid character");} else {Console. writeLine ("valid");} // daffodils rule // int I = 1*1*1 + 5*5 + 3*3; // calculate the daffodils of 100_999 for (int I = 100; I <= 999; I ++) {// detach a 10th percentile from int ge = I % 10; int shi = I/10% 10; int bai = I/100; // determine if (I = ge * ge + shi * shi + bai * bai) {Console according to the daffodils rule. writeLine (I) ;}} Console. readKey (); // calculate the even number of bytes 100 and int sum = 0; for (int I = 1; I <=; I ++) {// if I can be divisible by 2, it indicates that this number is an even number if (I % 2www.2cto.com
= 0) {+ = I; Console. WriteLine (I) ;}} Console. WriteLine (sum); Console. ReadKey ();}