简体   繁体   中英

how to split a string with multiple delimeters in vba?

I am trying to split a string. I am using the split function, but I am unable to do for multiple delimiters.

Course Details = Split("ENM/5200-Fall2014/aba","/")

Consider using the replace function to change the - to / (assuming the - isn't used in other text)

for if you just have -

Split(Replace("ENM/5200-Fall2014/aba", "-", "/"), "/")

for if you have - and ( and ) it drops the )'s and only looks at the - (, but if we need to we can alter it so the "" has ")" to replace with "/" as well

Split(Replace(Replace(Replace("ENM/5200-Fall2014(aba)", "-", "/"),"(","/"), ")",")"), "/")

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