If I have the following string variable with these entries:

median_age_____
median_age_group1__
median_age_group23___
median_age_group23456
median_age_group234__
...

What is the best way to get the following, given that at the end of each string "_" is not consistent in terms of the number of characters it takes up?

median_age
median_age_group1
median_age_group23
median_age_group23456
median_age_group234
...