简体   繁体   中英

Excel/Python - Extract desired substring from a string

<font color="green">abc test <u>Name on Lobby</u></font> 
<font color="green">abc test</u></font> 
<font color="yellow">abc test</font> 

Is there a generic Excel formula that I can extract only 'abc test' from above three strings?

If we can do it on Python, that will also work. Thanks!

假设你想要的字符串总是在第一个>和第二个<之间,并且上面的行是它自己的字符串,你可以使用这个函数:

=MID(A1, FIND(">", A1)+1, FIND("<", RIGHT(A1, LEN(A1) - FIND(">",A1)))-1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM