in reply to Re: Re: Re: Substitute _last_ occurence in string?
in thread Substitute _last_ occurence in string?

This assumes that there is more than one 'two'
No, it doesn't. The only problem comes from the handling of surrounding spaces, but that goes for most solutions here. Your solution eats up all whitespace before the 'two' - and kills words like 'onetwo'. These things might or might not be OK, depending on what you want to do with the string afterwards ... but we don't know.

So there is mtowtdi - surprise :) - but without more information, we can't tell which works best.

-- Hofmator

  • Comment on Re4: Substitute _last_ occurence in string?