How to read embedded resource text file and split the text lines into a List in C#

1 Answer

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

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Properties.Resources.textfile;
            List<string> list = s.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();

            foreach (string line in list)
            {
                Console.WriteLine(line);
            }
        }
    }
}


/*
run:
      
java c c++ c# php 
javascript 
python

*/

 



answered Dec 26, 2016 by avibootz

Related questions

2 answers 329 views
1 answer 263 views
1 answer 324 views
1 answer 196 views
196 views asked Mar 12, 2015 by avibootz
1 answer 184 views
1 answer 259 views
...