try this code:
vb Code:
  1. dim a as long
  2. a = InStr(trimStrLine, strEndPoint)
  3. if a > 0 then
  4. trimStrLine = Mid$(trimStrLine, 1, a - 1)
  5. end if