本文介绍了IsNumeric问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在尝试检查一个字符串,看看它的前3个字符是否为数字 如果是,则替换这3个字符用其他东西。 我试过这个但没有任何反应...... newname = Replace(newname,VB.Left( newname,3)=" 101-"," 101。") 到目前为止,我一直在使用的方法很长,而且时间太长了我需要一个更有效的方式来做这件事。 这就是我用过的...... 如果VB.Left(newname,3)=" 01-"或者VB.Left(newname,3)=" 02-" _ 或VB.Left(newname,3)=" 03-"或VB.Left(newname,3)=" 04-" _ 或VB.Left(newname,3)=" 05-"或VB.Left(newname,3)=" 06-" _ 或VB.Left(newname,3)=" 07-"或者VB.Left(newname,3)=" 08-" _ 或VB.Left(newname,3)=" 09-"或VB.Left(newname,3)=" 10-"然后 newname =替换(newname," 01-"," 01。") newname =替换(newname," 02-", " 02。") newname =替换(newname," 03-"," 03。") newname =替换(newname," ; 04-"," 04。") newname =替换(newname," 05-"," 05。") newname =替换(新名称,06-,06。) newname =替换(新名称,07-,07。) newname =替换(newname," 08-"," 08。") newname =替换(newname," 09-"," 09。 ") newname =替换(newname," 10-"," 10。") 结束如果 任何想法? 干杯, Paul Hi,I am trying to check a string to see if it''s first 3 characters are numericand if they are, to replace those 3 characters with something else. I''ve tried this but nothing happens... newname = Replace(newname, VB.Left(newname, 3) = "101-", "101. ") The method I''ve been using up to now is very drawn out and too long and Ineed a more efficient way of doing it.This is what I''ve beeni using... If VB.Left(newname, 3) = "01-" Or VB.Left(newname, 3) = "02-" _Or VB.Left(newname, 3) = "03-" Or VB.Left(newname, 3) = "04-" _Or VB.Left(newname, 3) = "05-" Or VB.Left(newname, 3) = "06-" _Or VB.Left(newname, 3) = "07-" Or VB.Left(newname, 3) = "08-" _Or VB.Left(newname, 3) = "09-" Or VB.Left(newname, 3) = "10-" Thennewname = Replace(newname, "01-", "01. ")newname = Replace(newname, "02-", "02. ")newname = Replace(newname, "03-", "03. ")newname = Replace(newname, "04-", "04. ")newname = Replace(newname, "05-", "05. ")newname = Replace(newname, "06-", "06. ")newname = Replace(newname, "07-", "07. ")newname = Replace(newname, "08-", "08. ")newname = Replace(newname, "09-", "09. ")newname = Replace(newname, "10-", "10. ")End If Any ideas?Cheers,Paul推荐答案 这篇关于IsNumeric问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-17 13:58