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
textstringThe text to capitalize.
separatorstringThe separator character sequence used between artist and title.
Returns
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
textstringThe text to check for brackets.
leftList<char>List of left bracket characters found.
rightList<char>List of right bracket characters found.
isMustBeLeftAndRightboolIf true, both left and right brackets must be present.
Returns
GetArtist(string)
Extracts the artist name from a formatted text string.
public static string GetArtist(string text)
Parameters
textstringThe formatted text to extract the artist from.
Returns
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
textstringThe formatted text to parse.
artiststringThe extracted artist name.
titlestringThe extracted title.
GetArtistTitleRemix(string)
Parses a formatted string into artist, title, and remix components.
public static Tuple<string, string, string> GetArtistTitleRemix(string text)
Parameters
textstringThe formatted text to parse (e.g. "Artist - Title [Remix]").
Returns
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
textstringThe formatted text to parse (e.g. "Artist - Title [Remix]").
artiststringThe extracted artist name.
songstringThe extracted song title.
remixstringThe extracted remix information.
GetTitle(string)
Extracts the song title from a formatted text string.
public string GetTitle(string text)
Parameters
textstringThe formatted text to extract the title from.
Returns
ReplaceAllHyphensExceptTheFirst(string, string)
Replaces all hyphens except the first one with the specified replacement string.
public static string ReplaceAllHyphensExceptTheFirst(string text, string replacement = " ")
Parameters
textstringThe text to process.
replacementstringThe string to replace hyphens with (default is a space).
Returns
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
textstringThe hyphen-separated text to reverse.