I have strings like 10A or 20B. I want 10 in 10A or 20 in 20B. How to split only numbers from string using VBScript or QTP internal commands?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I would use a regular expression:
s = "20B"
Set re = New RegExp
re.Pattern = "^\d+"
For Each m In re.Execute(s)
num = CInt(m)
Next
WScript.Echo num