How to convert array to queue in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

class Program
{
    static void Main() {
        string[] array = {"Cullen", "Artemis", "Arthur", "Aurora", "Cora"};
        
        Queue<string> queue = new Queue<string>(array);
        
        Console.WriteLine(string.Join(", ", queue.ToArray()));
    }
}




/*
run:

Cullen, Artemis, Arthur, Aurora, Cora

*/

 



answered Aug 7, 2022 by avibootz

Related questions

1 answer 263 views
263 views asked Apr 17, 2020 by avibootz
1 answer 250 views
250 views asked Aug 7, 2022 by avibootz
1 answer 252 views
252 views asked Apr 21, 2020 by avibootz
1 answer 293 views
1 answer 187 views
1 answer 199 views
199 views asked Aug 3, 2022 by avibootz
2 answers 398 views
398 views asked May 5, 2020 by avibootz
...