Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
Function LeftTrim(s)
|
||||
Set regex = New RegExp
|
||||
With regex
|
||||
.Pattern = "^\s*"
|
||||
If .Test(s) Then
|
||||
LeftTrim = .Replace(s,"")
|
||||
Else
|
||||
LeftTrim = s
|
||||
End If
|
||||
End With
|
||||
End Function
|
||||
|
||||
Function RightTrim(s)
|
||||
Set regex = New RegExp
|
||||
With regex
|
||||
.Pattern = "\s*$"
|
||||
If .Test(s) Then
|
||||
RightTrim = .Replace(s,"")
|
||||
Else
|
||||
RightTrim = s
|
||||
End If
|
||||
End With
|
||||
End Function
|
||||
|
||||
'testing the functions
|
||||
WScript.StdOut.WriteLine LeftTrim(" RosettaCode")
|
||||
WScript.StdOut.WriteLine RightTrim("RosettaCode ")
|
||||
WScript.StdOut.WriteLine LeftTrim(RightTrim(" RosettaCode "))
|
||||
Loading…
Add table
Add a link
Reference in a new issue