【发布时间】:2011-08-01 12:58:29
【问题描述】:
我有:
Dim Text = "some text here ###MONTH-3### some text here ###MONTH-2### some text here"
Dim regex = New System.Text.RegularExpressions.Regex("###MONTH[+-][0-9]###")
For Each match In regex.Matches(Text)
// What to write here ?
// So, that ###MONTH-i### gets replaced with getmonth(i)
// Therefore, final Text will be :
// Text = "some text here" + getmonth(-3) + "some text here" + getmonth(-2) + "some text here"
Next match
我想我已经正确解释了我的问题..
那么,你能帮忙吗?
【问题讨论】:
-
是的,你真的应该开始使用 Option Explicit ...
-
他可能正在使用Option Infer。编写编译器可以为您解决的代码毫无意义。
-
没错,我想这对于文字和非常明显的表达是可以接受的。
-
为什么建议您使用
Option Explicit? > 这对这里有什么帮助?