Search code examples
stringxamarinxamarin.formsxamarin.androidstring-conversion

Button text "&gt;" and "&lt;" is not converting to ">" and "<" in xamarin forms


I just need to display ">" and "<" as button text so I just used &gt with a semicolon and &lt with semicolon but in the UI it is showing the text instead of "<" and ">". But it is working fine in Xaml not in code behind c# file.

Please find the code

        CustomButton moveToNewCheckButton = new CustomButton
        {
            Text = "&gt;",
            Style = (Style) Application.Current.Resources["MoveButtonStyle"],
            AutomationId = "MoveToNewCheckButton"
        };

Solution

  • just use

    Text = ">",