Extract part of a string between point A and B

后端 未结 5 1066
遥遥无期
遥遥无期 2020-12-16 12:02

I am trying to extract something from an email. The general format of the email will always be:

blablablablabllabla hello my friend.

[what I want]

Goodbye          


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 12:29

    you can also use Regex

    string s =  Regex.Match(yourinput,
                            @"hello my friend(.+)Goodbye my friend", 
                            RegexOptions.Singleline)
                .Groups[1].Value;
    

提交回复
热议问题