DiscordRadioBot/Classes/YoutubeSearchEngine.cs
/// <summary>
/// Parses a Search Query using the list of words given.
/// </summary>
/// <param name="words"> List of Words for the Search Query. </param>
/// <returns></returns>
Parses a Search Query using the list of words given.
Parses a Search Query using the list of words given .
private string ParseSearchQuery(List<string> words)
        {
            StringBuilder stringBuilder = new StringBuilder();
            WriteLine($"\nList of Words: ");
            foreach(string word in words)
            {
                if(word != words[words.Count - 1])
                {
                    stringBuilder.Append(word);
                    stringBuilder.Append(" ");
                    Write($"{word}, ");
                }
                else
                {
                    stringBuilder.Append(word);
                    Write($"{word}.\n");
                }
            }
            string searchQuery = stringBuilder.ToString();
            WriteLine($"\nSearch Query: {searchQuery}\n");
            return searchQuery;
        }
private string ParseSearchQuery ( List < string > words ) { StringBuilder stringBuilder = new StringBuilder ( ) ; WriteLine ( $" \n List of Words:  " ) ; foreach ( string word in words ) { if ( word != words [ words . Count - 1 ] ) { stringBuilder . Append ( word ) ; stringBuilder . Append ( " " ) ; Write ( $" { word } ,  " ) ; } else { stringBuilder . Append ( word ) ; Write ( $" { word } . \n " ) ; } } string searchQuery = stringBuilder . ToString ( ) ; WriteLine ( $" \n Search Query:  { searchQuery } \n " ) ; return searchQuery ; }
Parses a Search Query using the list of words given.
Parses a Search Query using the list of words given .
None
words
List<string>
List of Words for the Search Query.
List of Words for the Search Query .