Commit 0d1dcc9f authored by atraczyk's avatar atraczyk Committed by Adrien Béraud

fallback avatar: fix getUpperInitial to skip spaces if any

Change-Id: I8446fc7a88c8c1b2a5a76cf6ad60f8fc8e784a4f
parent cef2cb62
......@@ -336,14 +336,17 @@ TrimCmd(Platform::String^ s)
String^
getUpperInitial(String^ str)
{
if (str != nullptr || str != "") {
std::wstring s(str->Data());
auto it = str->Begin();
wchar_t ch[] = L" ";
ch[0] = towupper(it[0]);
return ref new String(ch);
if (str == nullptr || str == "") {
return "?";
}
return "?";
auto it = str->Begin();
wchar_t ch[] = L" ";
int index = 0;
ch[0] = towupper(*it++);
while (it != str->End() && ch[0] == ' ') {
ch[0] = towupper(*it++);
}
return ref new String(ch);
}
Platform::String^
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment