Skip to content

Instantly share code, notes, and snippets.

@NiakmaJr
NiakmaJr / ConvertEmbed.cs
Created March 30, 2023 15:49
C# youtube link converter to embed
public string ConvertEmbed(string url)
{
if (url.Contains("/watch?v="))
{
url = url.Replace("/watch?v=", "/embed/");
}
else if (url.Contains("/youtu.be"))
{
url = url.Replace("/youtu.be/", "/youtube.com/embed/");
}