The purpose of this post is I want to practice Find apis – Synonym, refer to this document. The exercise this time is creating a tool for creating all English synonyms. The English synonyms resource I found at this website and I try to gather them to a list of useful Episerver Find synonyms. Step by step 1. […]
Random name using Linq
An LinQ example – I created this to name my baby ^_^
1 2 3 4 5 6 7 | static string RandomName(int length) { string libWord = "Stanley Jude Teddy Hugo Albert Ronnie Sonny Harriet Zara Violet Maryam Aisha Nancy Penelope Ellis Joey Jackson Thea Darcie Lottie Harper Nancy Robyn Evan Aiden Cameron Niamh Paige Skye Tilly Isobel Maddison Madison"; string original = libWord.Replace(System.Environment.NewLine, " "); var res = libWord.Split(Convert.ToChar(" ")); return res.ElementAt(new Random().Next(0, res.Count())); } |