Matthew Wilson wrote: > > What would be the best way to strip off the last "_asdf" from > "asdf_asdf_asdf"? s = "asdf_asdf_asdf" without_last_asdf = s[:-len("_asdf")] of course, that works only if you know it's there... if not, prepending with a test for s.endswith("_asdf") would do the trick. -Peter