Hello,
I have a string "<sip:username@10.10.10.10:5060>"
I would like just to get the "username", and nothing else.
I am using this code above. But and just Interested if there is a better more efficient way to do this.
Just looking to improve my code if that is possible, and also will this work for every situation that could arise. For example if the port number hasn't been included.
Many thanks,
I have a string "<sip:username@10.10.10.10:5060>"
I would like just to get the "username", and nothing else.
Code:
string callStatus = "<sip:username@10.10.10.10:5060>";
string usernameAndIP = callStatus.Remove(0, 5);
string[] username = usernameAndIP.Split('@');
this.lblCallStatus.Text = username[0].ToString();
I am using this code above. But and just Interested if there is a better more efficient way to do this.
Just looking to improve my code if that is possible, and also will this work for every situation that could arise. For example if the port number hasn't been included.
Many thanks,