'********************************************************************

'*

'* Function LChopText

'*

'*   Author: NetworkAdminKB.com

'*  Created: 2006-05-04

'* Modified: 2008-12-05

'*

'* Purpose: Returns a string with the text removed from Left side of String

'*            up to the first occurrance of the specified matching string/char.

'*

'* Input:   strTrim = A string to be trimmed.

'*         strMatch = A string/Character to search for in strTrim.

'*          blnCase = A boolean indicating case sensitive searches

'*                      True  = Case Sensitive Search

'*                      False = Case Insensitive Search (Default)

'*        blnRemove = A boolean indicating whether to remove the specified

'*                      strMatch as well

'*                      True  = Remove strMatch as well

'*                      False = Leave strMatch (Default)

'*

'* Output:  Returns the specified string with the characters removed.

'*

'* Calls:

'* ReturnCaseComparisonValue

'*

'* Changes:

'* 2007-01-06: Added intSearch, blnCase and blnRemove

'* 2008-12-05: Removed intSearch and use ReturnCaseComparisonValue instead.

'* 2008-12-05: Added "Or (blnRemove And intLoc=1)" to remove begining of

'*               string as specified.

'********************************************************************

Function LChopText(ByVal strTrim, ByVal strMatch, ByVal blnCase, ByVal blnRemove)

  'Version: 1.1 2008-12-05

  Dim strTemp, intLoc

 

  intLoc = InStr(1, strTrim, strMatch, ReturnCaseComparisonValue(blnCase))

 

  If intLoc > 1 Or (blnRemove And intLoc=1) Then

    If blnRemove Then

      strTemp = Mid(strTrim, intLoc + 1)

    Else

      strTemp = Mid(strTrim, intLoc)

    End If 'blnRemove

  Else

    strTemp = strTrim

  End If 'intLoc > 1 Or (blnRemove And intLoc=1)

 

  LChopText = strTemp

End Function 'LChopText

 

Article ID: 403, Created On: 9/25/2011, Modified: 9/25/2011