TheBulgarianWolf

Repeat Strings

Mar 17th, 2021
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RepeatStrings
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string[] stringArr = { "Dog", "Cat", "Mouse" };
  10.             string line = "";
  11.             foreach(string word in stringArr)
  12.             {
  13.                 for(int i = 0; i < word.Length; i++)
  14.                 {
  15.                     line += word;
  16.                 }
  17.             }
  18.             Console.WriteLine(line);
  19.         }
  20.     }
  21. }
  22.  
Add Comment
Please, Sign In to add comment