udfStrTrimRight (sString)
;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfstrtrimleft",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfstrtrimleft

#DefineFunction udfStrTrimLeft (sString)
If (sString=="") Then Return (sString)
Return (StrSub(sString,StrIndex(sString,StrTrim(sString),0,@FWDSCAN),-1))
; Detlev Dalitz.20020130
#EndFunction

:skip_udfstrtrimleft
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
If ItemLocate("udfstrtrimright",IntControl(77,103,0,0,0),@TAB) Then Goto skip_udfstrtrimright

#DefineFunction udfStrTrimRight (sString)
If (sString=="") Then Return (sString)
sTemp = StrTrim(sString)
Return (StrSub(sString,1,StrIndex(sString,sTemp,0,@FWDSCAN)+StrLen(sTemp)-1))
; Detlev Dalitz.20020130
#EndFunction

:skip_udfstrtrimright
;------------------------------------------------------------------------------------------------------------------------------------------



;--- test ---

sStringIn = " 1 2 3 test %TAB%  "

sStringOut = udfStrTrimLeft (sStringIn)
sMsgTitle = "Demo udfStrTrimLeft (str)"
sMsgText  = StrCat('StringIn',@TAB,'= "',sStringIn,'"',@CRLF,'StringOut',@TAB,'= "',sStringOut,'"')
Message(sMsgTitle,sMsgText)


sStringOut = udfStrTrimRight (sStringIn)
sMsgTitle = "Demo udfStrTrimRight (str)"
sMsgText  = StrCat('StringIn',@TAB,'= "',sStringIn,'"',@CRLF,'StringOut',@TAB,'= "',sStringOut,'"')
Message(sMsgTitle,sMsgText)

Exit
;------------------------------------------------------------------------------------------------------------------------------------------