vb 中 IIf(Right(File1.Path,1) = "\","","\")

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 08:27:59

vb 中 IIf(Right(File1.Path,1) = "\","","\")
vb 中 IIf(Right(File1.Path,1) = "\","","\")

vb 中 IIf(Right(File1.Path,1) = "\","","\")
授人以鱼不如授人以渔
IIF(条件,值1,值2)
IIF语句的意思是,如果条件成立,则返回值1,否则返回值2
具体到你的代码,就是如果File1.Path 的最后一个字符是 ”\“ 就返回空,否则返回 ”\“
所以我想你的完整句子应该是这样的:
File1.Path = File1.Path & IIf(Right(File1.Path, 1) = "\", "", "\")