Skip to content

Instantly share code, notes, and snippets.

Andrew Aitken AndyA13

Block or report user

Report or block AndyA13

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AndyA13
AndyA13 / gist:147f079cf7d69c55038d
Last active May 15, 2019
Example Uri properties
View gist:147f079cf7d69c55038d
public class Program
{
public static void Main(string[] args)
{
Uri pageUri = new Uri("https://www.example.com/folder/page.aspx?query=1&sample=2#anchor");
Uri simpleUri = new Uri("http://www.example.com/folder");
Console.WriteLine("Uri Properties:");
Console.WriteLine();
@AndyA13
AndyA13 / gist:3859427
Last active Oct 11, 2015
To comma seperated list
View gist:3859427
private string ToCommaSeperatedString<T>(IEnumerable<T> items, Func<T, string> property)
{
if (items != null && items.Count() > 0)
{
List<string> values = new List<string>();
foreach (T item in items)
{
values.Add(property.Invoke(item));
}
You can’t perform that action at this time.