strsplit(string, '/') returns a list, of the same length as string itself (in this case 1).
So, here [[1]] returns the first element of that list, which is a vector c( '101', 'Testler Export', 'somthing', 'shomething else.txt')
Finally, [1:2] returns the first two elements of that vector, i.e. c('101', 'Testler Export').
string <- '101/Testler Export/somthing/shomething else.txt'
(split <- strsplit(x = string,
split = '/'))
#> [[1]]
#> [1] "101" "Testler Export" "somthing"
#> [4] "shomething else.txt"
(split_1 <- split[[1]])
#> [1] "101" "Testler Export" "somthing"
#> [4] "shomething else.txt"
(split_1_1n2 <- split_1[1:2])
#> [1] "101" "Testler Export"