I need to extract a string by judging two indicated strings from a long string in C#, e.g. there is a string
"weight: 30 pounds. Height: 2 meters."
I need to extract the string "30"
by judging that its front is "weight: "
and its behind is " pounds"
. I cannot use index as I have many strings like this to read. Sometimes the weight can be 100 pounds which makes the extraction from index incorrect. How to do this? Thanks.