i have been working on converting a python code to java related to my research work, i have a query in Python len() object. my problem is in [::-1] as the code provided.
i have tried to do it in java by simply an incremental loop but it does not work. it gives array out of bound exception at temp_line.split('$target/')[1].
for i in range(0, script_lines.__len__())[::-1]:
temp_line = script_lines[i]
if "$target/" in temp_line and "cp" in temp_line:
Case_num = 1 + int(temp_line.split('$target/')[1].split('.txt')[0])
return Case_num
i want to know what does [::-1] mean in the code so i can convert it to java.