管理された文字列で Trim() メソッドを呼び出して、先頭と末尾の空白を削除するのに苦労しています。
私はもう試した:
System::String^ filename = " export.csv ";
filename = System::String::Trim(filename);
filename = filename::Trim();
filename = filename.Trim();
これにより、次のエラーが発生します。
error C2665: 'System::String::Trim' : none of the 2 overloads could convert all the argument types
また
error C2825: 'filename': must be a class or namespace when followed by '::'
error C2039: 'Trim' : is not a member of ''global namespace''
error C2146: syntax error : missing ';' before identifier 'Trim'
error C3861: 'Trim': identifier not found
また
error C2228: left of '.Trim' must have class/struct/union
C++/CLI で管理された文字列をどのようにトリミングすることになっていますか? System::String::Trim()メソッドを使用できないのはなぜですか?