I can't figure this out. I can split on / and get an array, and I can see the function INDEX to get a specific numbered indexed element from the array, but can't find a way to say "the last element" in this function.推荐答案这个比较简单: =REGEXEXTRACT(A1,"[^/]+$")您可以使用以下公式:=REGEXEXTRACT(A1,"(?:.*/)(.*)$")也可以将其用作ArrayFormula:And also possible to use it as ArrayFormula:=ARRAYFORMULA(REGEXEXTRACT(A1:A3,"(?:.*/)(.*)$"))这里有更多信息: RegExExtract函数 语法的一些很好的例子我的个人正则表达式技巧列表the RegExExtract functionSome good examples of syntaxmy personal list of Regex Tricks此公式将执行以下操作:This formula will do the same:=INDEX(SPLIT(A1,"/"),LEN(A1)-len(SUBSTITUTE(A1,"/","")))但是A1需要三遍,这是不可能的.But it takes A1 three times, which is not prefferable. 这篇关于分割字符串并获取最后一个元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-02 14:46