I have a string like:
"super exemple of string key : text I want to keep - end of my string"
I want to just keep the string which is between "key : "
and " - "
. How can I do that? Must I use a Regex or can I do it in another way?
Perhaps, a good way is just to cut out a substring:
String St = "super exemple of string key : text I want to keep - end of my string";
int pFrom = St.IndexOf("key : ") + "key : ".Length;
int pTo = St.LastIndexOf(" - ");
String result = St.Substring(pFrom, pTo - pFrom);