mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #75510 from SilicDev/string_erase
Reimplement `String.erase()` as immutable method
This commit is contained in:
@@ -395,6 +395,12 @@ TEST_CASE("[String] Insertion") {
|
||||
CHECK(s == "Who is Frederic Chopin?");
|
||||
}
|
||||
|
||||
TEST_CASE("[String] Erasing") {
|
||||
String s = "Josephine is such a cute girl!";
|
||||
s = s.erase(s.find("cute "), String("cute ").length());
|
||||
CHECK(s == "Josephine is such a girl!");
|
||||
}
|
||||
|
||||
TEST_CASE("[String] Number to string") {
|
||||
CHECK(String::num(0) == "0");
|
||||
CHECK(String::num(0.0) == "0"); // No trailing zeros.
|
||||
|
||||
Reference in New Issue
Block a user