This is not ok, String::Replace() works differently if String length is 1 or 2.
After Replace(), either myString2 should be empty as well, or myString1 should remain “6”,
Note that, this is related to the copy constructor somehow, as if I create copyString as:
Bug in Tizen::Base::String::Replace(?)
Hi there,
Running the following code:
String myString = L"6"; String copyString = myString; AppLog("myString=[%S] copyString=[%S]", myString.GetPointer(), copyString.GetPointer()); copyString.Replace(L"6", L""); AppLog("myString=[%S] copyString=[%S]", myString.GetPointer(), copyString.GetPointer()); String myString2 = L"66"; String copyString2 = myString2; AppLog("myString2=[%S] copyString2=[%S]", myString2.GetPointer(), copyString2.GetPointer()); copyString2.Replace(L"6", L""); AppLog("myString2=[%S] copyString2=[%S]", myString2.GetPointer(), copyString2.GetPointer());
This is not ok, String::Replace() works differently if String length is 1 or 2.
After Replace(), either myString2 should be empty as well, or myString1 should remain “6”,
Note that, this is related to the copy constructor somehow, as if I create copyString as:
Then it is ok, myString remains “6”.
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio