Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Parsing a multi-line text file with comments
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here string test = "//comments\n1:0\n1:1\n2:1\n"; Console.WriteLine("Hello, world!"); List<string> testSplit = new List<string>(test.Split('\n')); for (int x = 0; x < testSplit.Count; x++) { Console.Write(testSplit[x]); if (testSplit[x].StartsWith("//")) { Console.Write("\t<-- this is a comment!"); } Console.WriteLine(""); } } } }
run
|
edit
|
history
|
help
0
Problem: on_off
Classes, properties, methods, ling begining
tc2_1siod_ga_tp1_benouirane_ex1
1.1 Basics: language constructs
Exp Regular
try base generic test
Xamarin
Dungeon Game
Evaluating a Mathematical expression in a string in C#
Testing 008