.net - c# extract values from key-value pairs in string -
i have string this:
blablablamorecontentblablabla?name=michel&score=5&age=28&iliedabouttheage=true
looks regular query string yes, i'm not in web context
now want extract values (after = sign) key , example,what name (michel), score(5), age(28) etc.
normally parse string position in string of word 'name', add 5 (length of 'name=') , name position 'start' search &-sign , name position 'end', , string between position start , end.
but there must better solution, regex thing?
try system.web.httputility.parsequerystring, passing in after question mark. need use system.web assembly, shouldn't require web context.
Comments
Post a Comment