Why is it that str.replace doesn't work sometimes?
I'm writing a script to convert Latex commands to bbcode by using the str.replace function and I'm confused as to why this works: if '\chapter' in line: line = line.replace('\chapter{', '[b][u]') line = line.replace('}', '[/b][/u]') but this doesn't: if '\title' in line:
Re: Why is it that str.replace doesn't work sometimes?
On Jun 24, 12:28 pm, unayok wrote: > On Jun 24, 12:11 pm, humn wrote: > > > but this doesn't: > > > if '\title' in line: > > line = line.replace('\title{', '[size=150][b]') > > line = line.replace('}