How can I insert these characters into C#

Asked

Viewed 264 times

4

How can I insert these characters into

┍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┑
│                                            │   
│                                            │   
│                                            │   
│                                            │   
│                                            │   
└╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┚

I wanted to use them to create menus on the console.

1 answer

6


Well I made a menu once as follows: where

(char) ' u2554'

you replace according to the link table on the Wiki

            string MenuDesenho = string.Empty;
            for (int i = 0; i < 36; i++) {
                MenuDesenho +=(""+(char)'\u2550');
            }
               string menu =((char)'\u2554'+MenuDesenho+(char)'\u2557'+"\n");
                menu += ((char)'\u2551' +"              Menu                  "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 1. Para adicionar um Quadrado      "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 2. Para adicionar um Retangulo     "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 3. Para adicionar um Circulo       "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 4. Para Remover uma figura         "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 5. Para mostrar a lista            "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 6. Para limpar todas as figuras    "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 7. Para limpar a Tela              "+(char)'\u2551'+"\n");
                menu += ((char)'\u2551' +" 8. Para Sair                       "+(char)'\u2551'+"\n");
                    menu += ((char)'\u255a'+MenuDesenho+(char)'\u255d');
Console.Write(menu);

here the link to see the code in ASCII Box

https://en.wikipedia.org/wiki/Box-drawing_character

In this link you can more detailed term for the language.

http://graphemica.com/%E2%95%93

Look at the dotnetfiddle how does it look.

According to your image would be so code:

using System;


public class Program
{
    public static void Main()
    {

        string MenuDesenho = string.Empty;
            for (int i = 0; i <28; i++) {
                MenuDesenho +=(""+(char)'\u254D');
            }
               string menu =((char)'\u250D'+MenuDesenho+(char)'\u2511'+"\n");
                menu += ((char)'\uFFE8' +"              Menu                  "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 1. Para adicionar um Quadrado      "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 2. Para adicionar um Retangulo     "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 3. Para adicionar um Circulo       "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 4. Para Remover uma figura         "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 5. Para mostrar a lista            "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 6. Para limpar todas as figuras    "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 7. Para limpar a Tela              "+(char)'\uFFE8'+"\n");
                menu += ((char)'\uFFE8' +" 8. Para Sair                       "+(char)'\uFFE8'+"\n");
                menu += ((char)'\u2514'+MenuDesenho+(char)'\u251A');
        Console.Write(menu);
    }
}
  • what is the Menudesenho?

  • 1

    It’s a straight For, I’m sorry I thought it was your drawing of the question I already arranged

Browser other questions tagged

You are not signed in. Login or sign up in order to post.