Merge pull request #40092 from hinlopen/remove-find-last

Remove String::find_last (same as rfind)
This commit is contained in:
Rémi Verschelde 2020-07-04 01:38:01 +02:00 committed by GitHub
commit c020eea184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 41 additions and 80 deletions

View file

@ -710,11 +710,11 @@ void AnimationPlayerEditor::_dialog_action(String p_file) {
Ref<Resource> res = ResourceLoader::load(p_file, "Animation");
ERR_FAIL_COND_MSG(res.is_null(), "Cannot load Animation from file '" + p_file + "'.");
ERR_FAIL_COND_MSG(!res->is_class("Animation"), "Loaded resource from file '" + p_file + "' is not Animation.");
if (p_file.find_last("/") != -1) {
p_file = p_file.substr(p_file.find_last("/") + 1, p_file.length());
if (p_file.rfind("/") != -1) {
p_file = p_file.substr(p_file.rfind("/") + 1, p_file.length());
}
if (p_file.find_last("\\") != -1) {
p_file = p_file.substr(p_file.find_last("\\") + 1, p_file.length());
if (p_file.rfind("\\") != -1) {
p_file = p_file.substr(p_file.rfind("\\") + 1, p_file.length());
}
if (p_file.find(".") != -1) {