Re: Removing a substring from a string

2006-01-16 Thread Paul Watson
ankit wrote: > Hi All, > I want to remove a substring from a string without any additional > tabs/returns in the output string. Is there any method availaible or > how can I do it. For the ease, I am giving an example: > > [code] > mainstr =""" > ${if:isLeaf} > Dont include this isLeaf=True > ${

Re: Removing a substring from a string

2006-01-16 Thread Peter Hansen
ankit wrote: > I am using mainstr.replace(substr, "") but it gives me additional > carriage returns which leads to empty spaces as follows: The .replace() method does *not* introduce additional carriage returns (nor newlines/linefeeds, which is probably what you meant). If you think it does, yo