That totally doesn't fit through, you left the important points of questions, you need to tell whether it is the first element you want, or the last or the username itself and so on.
But, let me go through a few examples, if it is the first element you want in your string, then the following code would be enough.
string completeStr = "UserName: tghgd bhbj bhbh hb";
string firstElement = completeStr.Split(':')[0];
string trimmedStr = firstElement.Trim();
You can read the MSDN documentations to learn more about these functions, and how are they used in your application. You will find good code examples of these methods there, and some remarks from the developers about these functions.
https://msdn.microsoft.com/en-us/library/system.string.split%28v=vs.110%29.aspx[
^] Contains all of the overloaded methods for Split function.
https://msdn.microsoft.com/en-us/library/t97s7bs3%28v=vs.110%29.aspx[
^] Trim function.
https://msdn.microsoft.com/en-us/library/2549tw02.aspx[
^] Might be helpful to read for indexers.