Hello,
Welcome to our Microsoft Q&A platform!
We’ve identified the cause and are considering a change for a future release of Windows 10. Currently, as a workaround, you can add a space to the end of the value, or if a space already exists at the end, Trim it. For example:
Update:
void ChangeTitleAppCX::MainPage::MySetTitle(Platform::String^ title)
{
auto view = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView();
view->Title = title;
bool shouldTrimForMismatch = true;
std::wstring str = view->Title->Data();
std::wstring str1 = title->Data();
str.erase(str.find_last_not_of(L" ") + 1);
str1.erase(str1.find_last_not_of(L" ") + 1);
while (!str._Equal(str1))
{
wchar_t myString[1024] = L" ";
const wchar_t* lastCharacter = title->Begin() + (title->Length() - 1);
if (!wcscmp(lastCharacter, myString) && shouldTrimForMismatch)
{
std::wstring wsstr(title->Data());
wsstr.pop_back();
title = ref new Platform::String(wsstr.c_str());
}
else
{
title = Platform::String::Concat(title, L" ");
}
view->Title = title;
shouldTrimForMismatch = false;
str = view->Title->Data();
str1 = title->Data();
str.erase(str.find_last_not_of(L" ") + 1);
str1.erase(str1.find_last_not_of(L" ") + 1);
}
}