I'm trying to check if a textbox starts with a -.

I tried the following code, but it doesn't work:

if(textbox1->Text::StartWith("-"))

if(String(textbox1->Text).StartWith("-");
有帮助吗?

解决方案

Assuming this is C++/CLI and WinForms (in which case your question really needs retagging),

if (textBox1->Text->StartsWith("-"))
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top