我在尝试将句子拆分为单个子字符串时遇到了一些问题。使用 split 函数,我无法使用超过一个分隔符。代码是:
sentence = "If you're visiting this page, you're likely here because you're searching for a random sentence"
split(sentence, "," , " " , ";")
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
LoadError: MethodError: no method matching split(::String, ::String, ::String, ::String).
Run Code Online (Sandbox Code Playgroud)
我想获得一组单词。