johnkainn
asked on
remove part of string
I have a string. I want to find the last instance of "(" and remove it and everything that is behind it.
For example:"skj(ælsu(39)". I would like to return: "skj(ælsu"
How do I do that
For example:"skj(ælsu(39)". I would like to return: "skj(ælsu"
How do I do that
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
string x = "skj(ælsu(39)";
if(x.Contains('(')
x=x.Substring(0,x.LastInde xOf('(');
if(x.Contains('(')
x=x.Substring(0,x.LastInde
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This should do the trick:
Open in new window