skipter

C# Tricky Strings - Debugging

Jun 23rd, 2017
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. namespace _19.DebugTrickyString
  3. {
  4.     class Program
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             string delimiter = Console.ReadLine();
  9.             int numberOfStrings = int.Parse(Console.ReadLine());
  10.             string currentString = string.Empty;
  11.             string result = string.Empty;
  12.  
  13.             for (int i = 1; i <= numberOfStrings; i++)
  14.             {
  15.                 currentString = Console.ReadLine();
  16.                 result += currentString + delimiter;
  17.             }
  18.             int remove = delimiter.Length;
  19.             Console.WriteLine(result.Remove(result.Length - remove, remove));
  20.         }    
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment