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

fallback avatar: fix getUpperInitial to skip spaces if any

Change-Id: I8446fc7a88c8c1b2a5a76cf6ad60f8fc8e784a4f
parent cef2cb62
...@@ -336,14 +336,17 @@ TrimCmd(Platform::String^ s) ...@@ -336,14 +336,17 @@ TrimCmd(Platform::String^ s)
String^ String^
getUpperInitial(String^ str) getUpperInitial(String^ str)
{ {
if (str != nullptr || str != "") { if (str == nullptr || str == "") {
std::wstring s(str->Data()); return "?";
auto it = str->Begin();
wchar_t ch[] = L" ";
ch[0] = towupper(it[0]);
return ref new String(ch);
} }
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^ Platform::String^
......
Supports Markdown
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