fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string str = @"N:
  8. TEL:+65123345
  9. END:VCARD
  10. BEGIN:VENV
  11. BEGIN:VBODY
  12. Date:8/11/2013 11:59:00 PM
  13. thi is a test message
  14. Hello this is a test message on line 2
  15. END:VBODY
  16. END:VENV
  17. END:VENV
  18. END:VMSG";
  19.  
  20. int startId = str.IndexOf("BEGIN:VBODY")+11;
  21. int endId = str.IndexOf("END:VBODY");
  22. string sub = str.Substring(startId, endId-startId);
  23. Console.WriteLine(sub);
  24. }
  25. }
Success #stdin #stdout 0.05s 33888KB
stdin
Standard input is empty
stdout
Date:8/11/2013 11:59:00 PM
thi is a test message
Hello this is a test message on line 2