<?xml version="1.0"?>
<component>

<registration
	description="MyTrimFunctions"
	progid="MyTrimFunctions.WSC"
	version="1.00"
	classid="{7d9ba1dc-31f4-474b-a349-db6fe753573b}"
>
</registration>

<public>
	<method name="MyLRTrim">
		<PARAMETER name="StringToTrim"/>
	</method>
	<method name="MyTrim">
		<PARAMETER name="StringToTrim"/>
	</method>
</public>

<script language="VBScript">
<![CDATA[

function MyLRTrim(StringToTrim)
Dim  TrimedString,CurrentSymbol
StartCharNumber=0
FinishCharNumber=0
LengthOfLine = Len(StringToTrim)
i=1

If LengthOfLine>=1 Then
 CurrentSymbol= Mid(StringToTrim,i,1)
 Do While CurrentSymbol = " "
  i = i+1
  CurrentSymbol = Mid(StringToTrim,i,1)
 Loop
 StartCharNumber = i
 i = LengthOfLine
 CurrentSymbol = Mid(StringToTrim,i,1)
 Do While CurrentSymbol = " "
  i = i-1
  CurrentSymbol = Mid(StringToTrim,i,1)
 Loop
 FinishCharNumber=i
 i = StartCharNumber
 
 For i=StartCharNumber to FinishCharNumber
  CurrentSymbol = Mid(StringToTrim,i,1) 
  TrimedString = TrimedString&CurrentSymbol
 Next
 
End If
MyLRTrim = TrimedString 
end function

function MyTrim(StringToTrim)
Dim  TrimedString,CurrentSymbol
LengthOfLine = Len(StringToTrim)

If LengthOfLine>1 Then
 For i=1 to LengthOfLine
  CurrentSymbol = Mid(StringToTrim,i,1)
  If CurrentSymbol <> " " Then
   TrimedString = TrimedString&CurrentSymbol 
  End If
 Next
End If
MyTrim = TrimedString 
end function

]]>
</script>

</component>
