static void testAllSubstrings() { string str = "rajat"; List <string> substrings = StringProblems.getAllSubstrings(str); Console.WriteLine(substrings.Count + " substrings for " + str + " are: "); foreach (string substr in substrings) { Console.Write("[" + substr + "]"); } }