using System;
using System.Linq;

namespace MyCompiler {
    class Program {
        public static void Main(string[] args) 
        {
            Console.WriteLine("Hello world!");
            frame(4,5,'#');
            frame1(10, 3, '*');
        }
        
        public static void frame(int w,int h, char ch)
        {
            if(width < 3 || length < 3)
            {
                var result = Enumerable.Range(0,h).Select(x => {
                    string str = x == 0 || x == h-1 ? new string(ch,w) : ch.ToString() + new string(' ',w-2) + ch.ToString();
                    return str;
                }).ToArray();
                return result;
            }
            return new string[]{"invalid"};
        }
        
        public static void frame1(int width,int length, char str)
        {
            string[] arr = new string[length];
            foreach(int i in Enumerable.Range(0,length))
            {
               string res = "";
               if(i == 0 || i == length -1)
               {
                   res = new string(str,width);
               }   
               else
               {
                   res = str.ToString() + new string(' ',width -2) + str.ToString();
               }
               arr[i] = res;
            }
        }
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: