Mass string replace in python?

前端 未结 13 2227
我寻月下人不归
我寻月下人不归 2020-11-28 20:14

Say I have a string that looks like this:

str = \"The &yquick &cbrown &bfox &Yjumps over the &ulazy dog\"

You\'ll notic

13条回答
  •  借酒劲吻你
    2020-11-28 20:52

    try this

    tr.replace("&y",dict["&y"])

    tr.replace("&c",dict["&c"])

    tr.replace("&b",dict["&b"])

    tr.replace("&Y",dict["&Y"])

    tr.replace("&u",dict["&u"])

提交回复
热议问题