joh*_*253 0 arrays excel vba excel-vba
如何将多个分隔符用于split()函数?我想使用两个以上的单词作为分隔符,但我不确定这是怎么可能的.
c = Trim(t.value)
arr = Split(c, "hello" , "hi")
Run Code Online (Sandbox Code Playgroud)
您可以先使用replace替换多个单词,然后在拆分中使用它.
例如
mystring= Replace(mystring, "hello", "#")
mystring= Replace(mystring, "hi", "#")
mystring= Replace(mystring, "thanks", "#")
newstring= Split(mystring, "#")
Run Code Online (Sandbox Code Playgroud)