Esempio n. 1
0
 private static void FindStringOutputResult(string text, string subtext)
 {
     List<int> indexesList = new FindString().AllIndexesOf(text, subtext);
     if (indexesList.Count > 0)
         Console.WriteLine(string.Join<int>(", ", indexesList));
     else
         Console.WriteLine("No matches");
 }
 public void SearchForLl()
 {
     var indexesList = new FindString().AllIndexesOf(_text, "Ll");
     Assert.AreEqual(5, indexesList.Count);
     Assert.AreEqual(3, indexesList[0]);
     Assert.AreEqual(28, indexesList[1]);
     Assert.AreEqual(53, indexesList[2]);
     Assert.AreEqual(78, indexesList[3]);
     Assert.AreEqual(82, indexesList[4]);
 }
 public void SearchForPolly()
 {
     var indexesList = new FindString().AllIndexesOf(_text, "Polly");
     Assert.AreEqual(3, indexesList.Count);
     Assert.AreEqual(1, indexesList[0]);
     Assert.AreEqual(26, indexesList[1]);
     Assert.AreEqual(51, indexesList[2]);
 }
 public void SearchForPollyCaseSensitive()
 {
     var indexesList = new FindString(false).AllIndexesOf(_text, "Polly");
     Assert.AreEqual(1, indexesList.Count);
     Assert.AreEqual(1, indexesList[0]);
 }