c# how to request url parameters and change char

After getting some url parameters, I would like to use them later in my c# code, but in a slightly different format.


I am able to get the values as a string in their existing format using: c# code

public string myattendees()
    string attendees;
    attendees = Request.QueryString["attendees"];
    return attendees;
public string myspeakers()
    string speakers;
    speakers = Request.QueryString["speakers"];
    return speakers;

myattendees returns (separated with periods with no quotes)


and myspeakers returns (separated with periods with no quotes)


But I would like to convert it so it would return a string like these with comma separated and single quoted values.

'john' , 'sam'


'fred' , 'will' , 'tony' , 'amy' , 'al'

What would be the best way to do this in c#? Use a NameValueCollection?

*question edited for clarity on details. *edit - fixed spelling error.


This code will give you an array of strings acquired by splitting on dots:

string[] speakers;
if (Request.QueryString["speakers"] == null)
    speakers = new string[0];
    speakers = Request.QueryString["speakers"].Split('.');

try this:

public class MyClassGetQueryString

    private const string Attendees = "attendees";
    private const string Speakers = "speakers";

    public string MyAttendees()
        return Request.QueryString[MyClassGetQueryString.Attendees] ?? string.Empty;

    public string MySpeakers()
        return Request.QueryString[MyClassGetQueryString.Speakers] ?? string.Empty;

    public string[] MyAttendeesParts()
        return this.MyAttendees().Split('.');

    public string[] MySpeakersParts()
        return this.MySpeakers().Split('.');

Need Your Help

svg / raphael: scale path + get resulting/computed path

svg raphael scaling

Let's say I have this svg path (some icon) as a string:

why does async call LiveConnectClient.GetAsync block executing thread?

c# windows-store-apps async-await monogame live-connect-sdk

I have Windows Store MonoGame (based on XAML MonoGame template in Visual Studio 2012) app.