How to remove part of the path to a specific directory in a String?

Godot Version

Godot 3.5.3

Question

I have a path as a string - C:/Users/FireRun/Documents/NewProject/Data/Sprite/Top
in the project the starting path will always be different, but “Data” will always be found, how can I cut such a path to “Data” to get such a path - Data/Sprite/Top ?

var good_path = full_path.right(full_path.find("Data"))

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.