Accessing string from other script

Hi guys, I have a flappy bird like game , in which i want to put an online leaderbord(with dreamlo),But i have the score code in one script and username code in another.So, in order to add the highscores to dreamlo online leaderbord, need to acces the username string.( i’m new with unity/c# sorry if it sounds very stupid) From the tutorial,I need to put - Highscores.AddNewHighscore(username, score); right under the game code(if it was in one place).
Tried username = GetComponent(); but i get - Cannot implicitly convert type “InputName” to “string”.
Sorry again,
Thank you !

Inside the InputName class expose a public string that will hold the user name, like so:

class InputName : MonoBehaviour {
    //.... rest of the code
    public string UserName;
    //.... rest of the code
}

And inside your HigeScores class add this code:

class HigeScores: MonoBehaviour {
    //.... rest of the code
    // inside a function...
    string name = GetComponent<InputName>().UserName;
    //.... rest of the code
}