2016-05-05 105 views
-1

當我嘗試英文符號比較是這樣的:如何比較字符串符號與國家字母符號?

int SomeFunction(System::String^ eng) { 
    if(eng[0] == 'q') { return 0; } 
    else { return -1; } 
} 

所有的偉大工程。但我不能用uarus符號做同樣的事情。那我該如何比較呢?

+1

你的意思是你「不能」?編譯錯誤?運行時錯誤?沒有錯誤,但比較總是返回'false'?你能舉一個不適合你的角色的例子嗎? –

+0

[我如何通過字符比較來執行Unicode意識的字符?](http://stackoverflow.com/questions/27229589/how-can-i-perform-a-unicode-aware-character-by-character - 比較) –

+0

@David Yaw,是的,它總是返回一個錯誤。示例是「д」或「щ」 –

回答

-1

這對我的作品(該文件已被「高級」保存爲Unicode):

int main(array<System::String ^> ^args) 
{ 
    Console::WriteLine(L"Hello World"); 
    if (args[0][0] == L'Ж') { return 1; } 
    return 0; 
} 
+0

Khmm ...這個答案有什麼問題? –