Keep the combination of Excel functions as a memorandum.
=RIGHT(A1,LEN(A1)-FIND("★",SUBSTITUTE(A1,".","★",LEN(A1)-LEN((SUBSTITUTE(A1,".",""))))))
result
A1 cell sample.group1.StrClass
Result StrClass
=RIGHT(A1,LEN(A1)-FIND("★",SUBSTITUTE(A1,"\","★",LEN(A1)-LEN((SUBSTITUTE(A1,"\",""))))))
result
A1 cell C:\vbaSample\sample\test.txt
Result test.txt
=LEFT(A1,FIND("★",SUBSTITUTE(A1,"\","★",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))),1)-1)
result
A1 cell C:\vbaSample\sample\test.txt
Result C:\vbaSample\sample
=LEFT(A1,FIND("★",SUBSTITUTE(A1,"\","★",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))),1))
result
A1 cell C:\vbaSample\sample\test.txt
Result C:\vbaSample\sample\