Table of Contents

Class YouTube

Namespace
SunamoShared.Web
Assembly
SunamoShared.dll

Utility methods for YouTube URL parsing and link generation.

public static class YouTube
Inheritance
YouTube
Inherited Members

Methods

GetHtmlAnchor(string)

Generates an HTML anchor element linking to the specified YouTube video.

public static string GetHtmlAnchor(string videoCode)

Parameters

videoCode string

The YouTube video code.

Returns

string

GetLinkToSearch(string)

Generates a YouTube search URL for the specified query.

public static string GetLinkToSearch(string query)

Parameters

query string

The search query text.

Returns

string

GetLinkToVideo(string)

Generates a YouTube watch URL from a video code.

public static string GetLinkToVideo(string videoCode)

Parameters

videoCode string

The YouTube video code.

Returns

string

ParseYtCode(string)

Extracts the YouTube video code from a URL. Returns null if not found.

public static string ParseYtCode(string uri)

Parameters

uri string

The YouTube URL to parse.

Returns

string

ReplaceAll(string, List<string>, string)

Replaces all occurrences of specified strings with a replacement.

public static string ReplaceAll(string text, List<string> what, string replacement)

Parameters

text string

The input text.

what List<string>

The strings to replace.

replacement string

The replacement string.

Returns

string