I am reading a string of a socket. The sting contains key-value pairs using the hex 0x01 as delimitor. I would like to split the string to get the pairs, but can’t quite get my head around it.
Any help would be greatly appreciated.
.NET/C#. Framework 4.
Given a string
input, you can split it using theSplitmethod:You might want to use
StringSplitOptions.RemoveEmptyEntriesas well to remove any elements not containing any readable char.