修剪前导空格,包括制表符 [英] Trim leading spaces including tabs
本文介绍了修剪前导空格,包括制表符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用 vbscript 读取文件并删除所有前导空格,包括任何制表符.我现在 LTRIM 将删除前导空格,但我如何删除制表符.
I need to read files using vbscript and remove all leading spaces including any tabs. I now LTRIM will remove the leading spaces but how do I remove tabs also.
谢谢.
推荐答案
此函数从字符串中删除所有前导空格(空格、制表符等):
This function removes all leading whitespace (spaces, tabs etc) from a string:
Function LTrimEx(str)
Dim re
Set re = New RegExp
re.Pattern = "^\s*"
re.Multiline = False
LTrimEx = re.Replace(str, "")
End Function
这篇关于修剪前导空格,包括制表符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文