Very basic coding question

So I’ve done this before but I must’ve deleted the code… Anyways how do I check if a string is the same string regardless of caps and lowercase? Like if someone tries to choose an inappropriate username by messing with the capitalization, they can’t. All I have now are just some basic conditionals for usernames but the most important thing is that they can’t pick something inappropriate.
*
public void UsernameInputField()
{
//Make sure on inputfield value changed, check if the username is only numbers, has spaces or special characters, etc…
saveProfileButton.interactable = false;

        if (usernameInput.text.Length == 1 && usernameInput.text == " ")
        {
            usernameInput.text = null;
            return;
        }

        if (usernameInput.text.Length < 3)
        {
            return;
        }

        saveProfileButton.interactable = true;
    }

if (string1.ToLower() == string2.ToLower())