Link to home
Start Free TrialLog in
Avatar of addicktz
addicktz

asked on

Replace Double Character with Single Character

if I have a string

string a = "ee-----ee--ee----ee-";

and I wanted the string to be

string a = "ee-ee-ee-ee";

what regex expression would I use?

I have tried a variety combos without success, any ideas?

a = Regex.Replace(a, "[-]?", "-");
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of addicktz
addicktz

ASKER

gives me the same results as the original string, any other ideas?
ack. nevermind =]