I have a string
/sample/data
split
["","sample","data"]
"/sample/data".split('/').findAll(it != "")
cannot call String[] findAll with argument bool
You can do as below:
println "/sample/data".split('/').findAll {it}
findAll {it}
would fetch all the non empty values.