0

Example URL: https://www.facebook.com?username=123&password=*** I am trying to split the 'username' and 'password' parameters from the url. Here's what I have for the username

var userstring = url.Split('?username=')[1] && url.Split('&password=')[0];

I'm pretty sure this is wrong syntax as some of this is jQuery syntax. Help Please.

Mathew Dodson
  • 115
  • 1
  • 1
  • 10
  • Dont use `string.Split`, the framework already has built in Uri support. Just create a [`Uri`](https://learn.microsoft.com/en-us/dotnet/api/system.uri?view=netframework-4.7.2) object and use all the properties and methods contained there – maccettura Sep 18 '18 at 21:09
  • I feel like I've seen this before.. – dustytrash Sep 18 '18 at 21:09
  • https://stackoverflow.com/questions/2884551/get-individual-query-parameters-from-uri – Dmitry Bychenko Sep 18 '18 at 21:09

0 Answers0