fork(1) download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5.  
  6. public class Test
  7. {
  8.  
  9. public static void Main()
  10. {
  11. string fullText = "**LOAD SUBCASE1 SUBTITLE2 LOAD SUBCASE3 SUBTITLE4 load Load Load**";
  12.  
  13. var words = fullText.Split().Select((w, i) => new{Word = w, Index = i});
  14. var matches = words.Where(w => StringComparer.OrdinalIgnoreCase.Equals("load", w.Word));
  15. foreach(var match in matches)
  16. {
  17. Console.WriteLine("Index: {0}", match.Index);
  18. }
  19. }
  20. }
  21.  
  22.  
  23.  
Success #stdin #stdout 0.05s 34048KB
stdin
Standard input is empty
stdout
Index: 4
Index: 7
Index: 8