我有一些字符串
bla bla bla bla <I NEED THIS TEXT>
在<>
中获取文本的最佳和最快方法是什么? ?
最佳答案
int start = s.IndexOf("<") + 1;
int end = s.IndexOf(">",start);
string text = s.Substring(start,end - start);
关于C#。解析并在字符串中找到一些单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6185299/