VBScript中预计的语句

VBScript中预计的语句

问题描述:

我试图使用VB String.Trim(Char()) MethodVBScript中预计的语句

Dim charsToTrim() As Char = {"#"c} 
Dim buildNumber = buildNumberArg0.Trim(charsToTrim()) 

根据文档和various online discussions从字符串修剪字符“#”结束,即语法应该工作,但是我会在下面的错误“Dim charsToTrim()”行:

Error: Expected end of statement 
Code: 800A0401 

我在做什么错在这里?谢谢。

+5

的VBScript vb.net – Plutonix 2014-12-01 16:10:33

+0

你的意思是说我挂文件是不是VBScript的有效synthax /方法? – 2014-12-01 16:17:54

+3

是的。 VBScript和VB.NET是完全不同的语言。从这里开始:[MSDN上的VBScript文档](http://msdn.microsoft.com/zh-cn/library/t0aew7h6%28v=vs.84%29.aspx) – Tomalak 2014-12-01 16:21:29

VBScript只有一种称为Variant的数据类型。

试试这个:

dim strParent,strChild 
strParent="#this is an exa##mp#le of t#rim#m##ing#" 
strChild=Replace(strParent,"#","") 
'strChild="this is an example of trimming" 
wscript.echo strChild