.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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -