Trim a string after a spoecial character
What is the best way to use regex and remove everything after (":") using c#
I have a richtextbox and its populated with data that I load .
The data contain bunch of itemcodes some have (colon) and alphanumeric characters I dont need like for instance RE45O7:TAKEMOUT==> I just want to be able to have RE4507
This is what I have but is not working...
string str = rchTxtContent.Text;
string ext = str.Substring(str.LastIndexOf(":") + 1);