简体   繁体   中英

Replace several substrings to several substrings in single string using vba (excel)

please tell me whether it is possible to perform a replacement in a string that combines several different substitutions using VBA (excel)?

For example:

text = Replace(text, find1, res1)
text = Replace(text, find2, res2)

Real example:

text = Replace(text, " ", " ")
text = Replace(text, "&", "&")
text = Replace(text, "&lt", "<")

Maybe regexp?

嵌套它们:

Text = Replace(Replace(Replace(Text, "&nbsp;", " "), "&amp;", "&"), "&lt", "<")

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