Table of Contents

Class ManageArtistDashTitle

Namespace
SunamoShared.Entity
Assembly
SunamoShared.dll

Provides methods for parsing and managing artist-dash-title formatted strings.

public class ManageArtistDashTitle
Inheritance
ManageArtistDashTitle
Inherited Members
Extension Methods

Methods

ArtistAndTitleToUpper(string, string)

Capitalizes the first letter, and letters after spaces, hyphens, closing brackets, and opening parentheses.

public static string ArtistAndTitleToUpper(string text, string separator)

Parameters

text string

The text to capitalize.

separator string

The separator character sequence used between artist and title.

Returns

string

ContainsBracket(string, ref List<char>, ref List<char>, bool)

Checks whether the given text contains bracket characters.

public static bool ContainsBracket(string text, ref List<char> left, ref List<char> right, bool isMustBeLeftAndRight = false)

Parameters

text string

The text to check for brackets.

left List<char>

List of left bracket characters found.

right List<char>

List of right bracket characters found.

isMustBeLeftAndRight bool

If true, both left and right brackets must be present.

Returns

bool

GetArtist(string)

Extracts the artist name from a formatted text string.

public static string GetArtist(string text)

Parameters

text string

The formatted text to extract the artist from.

Returns

string

GetArtistTitle(string, out string, out string)

Extracts artist and title from a formatted text string, using the file name without extension.

public static void GetArtistTitle(string text, out string artist, out string title)

Parameters

text string

The formatted text to parse.

artist string

The extracted artist name.

title string

The extracted title.

GetArtistTitleRemix(string)

Parses a formatted string into artist, title, and remix components.

public static Tuple<string, string, string> GetArtistTitleRemix(string text)

Parameters

text string

The formatted text to parse (e.g. "Artist - Title [Remix]").

Returns

Tuple<string, string, string>

GetArtistTitleRemix(string, out string, out string, out string)

Extracts artist, song title, and remix information from the given text into out parameters.

public static void GetArtistTitleRemix(string text, out string artist, out string song, out string remix)

Parameters

text string

The formatted text to parse (e.g. "Artist - Title [Remix]").

artist string

The extracted artist name.

song string

The extracted song title.

remix string

The extracted remix information.

GetTitle(string)

Extracts the song title from a formatted text string.

public string GetTitle(string text)

Parameters

text string

The formatted text to extract the title from.

Returns

string

ReplaceAllHyphensExceptTheFirst(string, string)

Replaces all hyphens except the first one with the specified replacement string.

public static string ReplaceAllHyphensExceptTheFirst(string text, string replacement = " ")

Parameters

text string

The text to process.

replacement string

The string to replace hyphens with (default is a space).

Returns

string

Reverse(string)

Reverses the order of hyphen-separated parts in the text, swapping the first and last segments.

public static string Reverse(string text)

Parameters

text string

The hyphen-separated text to reverse.

Returns

string