0
问题我试图去掉名为“workorder”的字符串的所有“%”,出于某种原因,它不工作任何帮助将是非常非常感激!似乎无法让我的字符串剥离器在C++中正常工作
example:
String^workorder = "%QW1234%12%3"
with the below code I want it to spit out the workorder string like so = "QW1234123"
这里是我的代码
private: System::Void workorder_text_TextChanged(System::Object^ sender, System::EventArgs^ e) {
String^workorder;
workorder = workorder_text->Text;
//I CANT USE WORKORDER STRING FOR wO string for some reason....
string wO(workorder);
char bad_chars_wo[] = "%";
for (unsigned int i = 0; i < strlen(bad_chars_wo); ++i)
{
wO.erase (std::remove(wO.begin(), wO.end(), bad_chars_wo[i]), wO.end());
}
}