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