Concat function vb vs c# help

Hey guys!
A little heads up this might be a silly question, I’m still learning the proper syntaxes of C#, so I got stuck for almost 2h now in this tutorial.
I’m under that Variables Practice Tests and the video instructs us to create a string array as seen below.

Then at one point we have to iterate though the string array and filter them with a Switch statement using the following method in VB:


While this works in VB it doesnt not in C# and for the life of me I cannot figure out why.
Can anyone that has more knowledge in C# transpose this method?

Also it would be good if the tutorials would offer a C# alternative , at least in writing.
I’m thinking of saving every instance where it changes and offer it for review later.

Thanks in advance


You can use the namespace:
using System.Linq;

And applying the logic below, you can separate by array:

Foreach I just used to show the usability of the lists that were filled.

Alright, so I was trying to figure out how to convert items from an array of strings in C# using the Concat() method. Kinda trying to follow along the tutorial and just convert from VB to C# .
Because I know how to use Lists, and its a good point, maybe I’ll just go on my own and use the lists for the practice test.

Check this

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.