mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add String::replace_char(s) methods for performance and convenience
This commit is contained in:
@@ -42,9 +42,9 @@ String ProjectZIPPacker::get_project_zip_safe_name() {
|
||||
// In the project name, all invalid characters become an empty string so that a name
|
||||
// like "Platformer 2: Godette's Revenge" becomes "platformer_2-_godette-s_revenge".
|
||||
const String project_name = GLOBAL_GET("application/config/name");
|
||||
const String project_name_safe = project_name.to_lower().replace(" ", "_");
|
||||
const String project_name_safe = project_name.to_lower().replace_char(' ', '_');
|
||||
const String datetime_safe =
|
||||
Time::get_singleton()->get_datetime_string_from_system(false, true).replace(" ", "_");
|
||||
Time::get_singleton()->get_datetime_string_from_system(false, true).replace_char(' ', '_');
|
||||
const String output_name = OS::get_singleton()->get_safe_dir_name(vformat("%s_%s.zip", project_name_safe, datetime_safe));
|
||||
return output_name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user