I have a list of browser agent strings with each string looking like -
Mozilla/5.0 (iPad; CPU OS 6_1 like Mac OS X)
AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0
Mobile/10B141
Safari/8536.25
Using a foreach
loop I will be going through a list of these strings. On each iteration I want to extract just the OS version out which I'm assigning to a variable before I proceed to process further.
foreach (var e in AgentStrings)
{
var myOS = e.UserAgent GET JUST THE OS (6_1_3) ??
// will do more stuff here
}
What's the easiest way to essentially retrieve the value between OS and Like in the agent string?