Show tick symbol on label

前端 未结 4 1042
鱼传尺愫
鱼传尺愫 2020-12-28 14:38

How can I show \"√\" (tick symbol) in label text?

相关标签:
4条回答
  • 2020-12-28 14:43

    This should work as well:

    <asp:Label ID="Button1" runat="server" Text="&#8730;"></asp:Label>
    
    0 讨论(0)
  • 2020-12-28 14:55

    The Extended ASCII code for that symbol is 251.

    You could probably also do,

    char c = '√';
    Console.WriteLine("{0}", c);
    
    0 讨论(0)
  • 2020-12-28 15:00

    This code will do it for you:

    LblTick.Text  = ((char)0x221A).ToString();
    

    Edit:

    or even easier:

    lblTick.Text = "\u221A";
    

    Edit 2:

    And, as pointed out in a comment, that code (221A) is actually a square root symbol, not a tick. To use the true tick mark, you can use the following:

    lblTick.Text = "\u2713";
    

    or for a heavy tick mark, you can use the following (but you may get font issues with this one):

    lblTick.Text = "\u2714";
    

    (Credit to @Joey for that comment!)

    0 讨论(0)
  • 2020-12-28 15:00

    You can also use

    lblTick.Text="\u2714";
    
    0 讨论(0)
提交回复
热议问题