Answers for "vba remove leading blank space in string"

VBA
0

vba remove leading blank space in string

Option Explicit
Function trimWhiteSpace(s As String) As String
	Dim RE As Object: Set RE = CreateObject("vbscript.regexp")
	With RE
		.Global = True
		.MultiLine = True
		.Pattern = "^\s*(\S.*\S)\s*"
		trimWhiteSpace = .Replace(s, "$1")
	End With
End Function
Posted by: Guest on December-08-2020

Code answers related to "vba remove leading blank space in string"

Code answers related to "VBA"

Browse Popular Code Answers by Language