给定字符串:
p\u00e5 \u00e5rsbasis i marts.<br><br>P\u00e5 \u00e5rsbasis faldt industriproduktionen 0,6 procent (-0,3) mod analytikerkonsensus, der afventede et fald p\u00e5 0,8 procent.<br><br><table><tbody><tr><td>Eurozonen, %<\/td><td>marts, 2019<\/td><td>Konsensus<\/td><td>februar, 2019<\/td><\/tr><tr><td>Industriproduktion, YY<\/td><td>-0,6<\/td><td>-0,8<\/td><td>-0,3<\/td><\/tr><\/tbody><\/table>Konsensusdata
所需的字符串:
på årsbasis i marts.<br><br>På årsbasis faldt industriproduktionen 0,6 procent (-0,3) mod analytikerkonsensus, der afventede et fald på 0,8 procent.<br><br><table><tbody><tr><td>Eurozonen, %</td><td>marts, 2019</td><td>Konsensus</td><td>februar, 2019</td></tr><tr><td>Industriproduktion, YY</td><td>-0,6</td><td>-0,8</td><td>-0,3</td></tr></tbody></table>Konsensusdata
最佳答案
你可以试试:
string = b"p\u00e5 \u00e5rsbasis i marts.<br><br>P\u00e5 \u00e5rsbasis faldt industriproduktionen 0,6 procent (-0,3) mod analytikerkonsensus, der afventede et fald p\u00e5 0,8 procent.<br><br><table><tbody><tr><td>Eurozonen, %<\/td><td>marts, 2019<\/td><td>Konsensus<\/td><td>februar, 2019<\/td><\/tr><tr><td>Industriproduktion, YY<\/td><td>-0,6<\/td><td>-0,8<\/td><td>-0,3<\/td><\/tr><\/tbody><\/table>Konsensusdata"
print(string.decode('unicode_escape'))
输出:
'på årsbasis i marts.
På årsbasis faldt industriproduktionen 0,6 procent (-0,3) mod analytikerkonsensus, der afventede et fald på 0,8 procent.
Eurozonen, %<\/td>marts, 2019<\/td>Konsensus<\/td>februar, 2019<\/td><\/tr>Industriproduktion, YY<\/td>-0,6<\/td>-0,8<\/td>-0,3<\/td><\/tr><\/tbody><\/table>Konsensusdata'
关于python - 如何将给定的字符串转换为所需的字符串,如下面的 Python 所示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56252258/