Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 在字符串中插入隐藏字符_Vb.net - Fatal编程技术网

Vb.net 在字符串中插入隐藏字符

Vb.net 在字符串中插入隐藏字符,vb.net,Vb.net,我正在使用基于命中SQL server的Select语句的结果填充列表框。如果字符串符合某些条件,我当前正在将*添加到字符串中。但我意识到,这看起来很草率。有没有办法将隐藏字符添加到字符串中,然后稍后再查找该字符 这是我目前的代码: If FormType.Level = 10 then Mystring = "*" + Mystring end if If instr(Mystring, "*") > 0 then Msgbox("Alert! This is a special ci

我正在使用基于命中SQL server的Select语句的结果填充列表框。如果字符串符合某些条件,我当前正在将*添加到字符串中。但我意识到,这看起来很草率。有没有办法将隐藏字符添加到字符串中,然后稍后再查找该字符

这是我目前的代码:

If FormType.Level = 10 then
Mystring = "*" + Mystring
end if

If instr(Mystring, "*") > 0 then
Msgbox("Alert! This is a special circumstance!")
end if

为什么不将您的“特殊情况”存储在另一个地方,例如
列表(字符串)

而不是将字符串放在列表框中,用自定义对象填充列表框。对象上可以有一个布尔值,用于确定特殊环境


我不确定您的程序是如何工作的,但我会将属性IsSpecialEnvironment设置为true或false。