string format is always like this “FirstName=ABC;LastName=XZY;Username=User1;Password=1234”.
I need the only UserName value (which is ‘User1’ in this case). I wanna achieve this in minimum line of code using substring method (or something else).
Help?
This method will work even if the value-pairs are given in a different order. It splits on the semicolon, finds the item with “Username”, then returns what’s after the equal sign.