For example, we just want to get the data inside double quotes from a list of strings:
String result = string.Empty;
List<string> strings = new List<string>();
strings.add("string=\"string\"");
strings.add("stringwithspace=\"string with space\"");
strings.add("untrimmedstring=\" untrimmed string\"");
strings.add("anotheruntrimmedstring=\"here it is \"");
strings.add("number=\"13\"");
strings.add("blank=\"\"");
strings.add("whitespace=\" \"");
StringBuilder z = new StringBuilder();
foreach(string x in strings){
if(x has a string inside the doublequote){ //do the regex here
z.append(x + "\n");
}
}
and the result would be:
string="string"
stringwithspace="string with space"
untrimmedstring="untrimmed string"
anotheruntrimmedstring="here it is"
number="13"
Any way we could do this?
Or are there some other easier and more optimized ways than using regex?
Thanks a lot.