Find and Replace Simplification

  • Thread starter Devyn Collier Johnson
  • Start date
J

Joshua Landau

21.07.13 14:29, Joshua Landau напиÑав(ла):



mapping.items(). We can implement s.translate({ord('<'): '&lt;', ord('&'):
'&amp;'}) as s.replace('&', '&amp;').replace('<', '&lt;'), but not as
s.replace('<', '&lt;').replace('&', '&amp;').

I see -- that won't always be the case though, as there can be "loops"
aka "ab" -> "ba".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,326
Latest member
Itfrontdesk

Latest Threads

Top