0

What is wrong with this code ?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string spaced = "ab c d e fgh i j kl mn opqr stuvwxyz"; char[] unspaced = spaced.ToCharArray(); string empty = null; foreach (char s in unspaced) if (char.IsLetter(s)) { empty += s; } } Console.Write(empty); } }

26th Apr 2020, 9:06 AM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
1 Answer
+ 1
Console.Write(empty) ; is out of main method. Write inside main, put before brace, after write.
26th Apr 2020, 9:36 PM
Jayakrishna 🇼🇳