c# remove certain part of a string

  • Thread starter Thread starter elfenliedtopfan55
  • Start date Start date
E

elfenliedtopfan55

Guest
ok i have multiple strings that i get though a file though a foreach loop they are all in this format

sndnt#ps_wfoly_plr_sm_mpapa7_reload_empty_xmag_045

what im trying to do is remove evreything before reload i would be left with

reload_empty_xmag_045

have tried to do following code but is not working as i thought it would work

int indexOfSteam = text.IndexOf("reload");
if (indexOfSteam >= -1)
text = text.Remove(indexOfSteam);

and this removes reload_empty_xmag_045

but i want it to remove to the left not right and cant seem to get this to work any help would be much appreciated

Continue reading...
 
Back
Top