Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.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 Visual Basic从特定行号中提取字符_Vb.net - Fatal编程技术网

Vb.net Visual Basic从特定行号中提取字符

Vb.net Visual Basic从特定行号中提取字符,vb.net,Vb.net,我正在处理一个宏,该宏需要能够检查并确保某一行上的字符在完成表单之前是应该的 我在哪里或如何找到执行此操作的信息 我已经尝试使用命令Leftof line,1,但现在无法让它返回任何内容。我假设您的文本是字符串。如果我的回答错了,请评论。 您可以使用正则表达式将字符串与您的字符进行比较,如下所示: If Regex.IsMatch(MyString, *.{X}Y) Then 'You have to manually replace X for the number of characters

我正在处理一个宏,该宏需要能够检查并确保某一行上的字符在完成表单之前是应该的

我在哪里或如何找到执行此操作的信息


我已经尝试使用命令Leftof line,1,但现在无法让它返回任何内容。

我假设您的文本是字符串。如果我的回答错了,请评论。 您可以使用正则表达式将字符串与您的字符进行比较,如下所示:

If Regex.IsMatch(MyString, *.{X}Y) Then
'You have to manually replace X for the number of characters before the character you scan for
'You have to manually replace Y for the-said character it is supposed to be
有关正则表达式的更多信息,请查看

如果只想在字符串中取一行:

TheLine = split(MyString,Environnement.Newline)([Line Number])

这是Visual Studio宏吗?或者?在上面左边的.Net中是stringName。Substring0,1它不适用于VISUAL STUDIO。我正在为道具软件制作一个宏。如果第9行的第一个字符是A>,我需要宏以一种方式继续,如果不是,则以另一种方式继续。如果不知道专有软件是什么及其宏语言,我们无法提供明确的帮助。尽管如此,如果您向我们展示更多的代码,让我们了解您遇到问题的地方,我们可能会为您解决一些问题。如果你对我们大喊大叫,你可能会把我们吓跑。对不起。我做的大部分工作都是用大写字母写的,直到我把它寄出去时我才忘了。我确实解决了这个问题。谢谢大家的帮助。当前代码是:If LeftReadLine9,1=$Then。Transmit P'&CR ElseIf LeftReadLine9,1$Then。Transmit no P'&CR End If–从何处读取该行?您必须指定它来自何处。函数ReadLine需要指向某个对象。例如:FileName.ReadLine或MyString.ReadLine。我建议尝试Regex.IsmatchMyString.ReadLine9,而不是使用Left,因为它不起作用,^A如果行以A开头,则该选项为真。