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:
mainstr ="""
${if:isLeaf}
Dont include this isLeaf=True
${/if:isLeaf}
${if:isStatic}
include this isStatic=True
${/if:isStatic}
"""
Now if I want to remove :
substr = ""
${if:isLeaf}
Dont include this isLeaf=True
${/if:isLeaf}
"""
Expected output is :
${if:isStatic}
include this isStatic=True
${/if:isStatic}
I am using mainstr.replace(substr, "") but it gives me additional carriage returns which leads to empty spaces as follows:
Actual Output:
${if:isStatic}
include this isStatic=True
${/if:isStatic}
Note: See additional newlines before isStatic tag
Any Suggestions ?