A string is a string, is a string: it doesn't matter where is came from - the user via a Console.ReadLine, a textbox.Text property, a Combobox.Value, or a static constant you typed before your app compiled.
In you app it's an instance of a string, that's all - so all the string properties and methods are available to you: String Class (System) | Microsoft Docs
That includes the string.Length property:
string read = Console.ReadLine();
string typed = MyTextBox.Text;
string compiled = "CODE";