      integer function lenstr (string)
      character*(*) string
c
c
c Determine the length of a string. The length is defined as 
c right justified and allowances are made for blanks at the 
c begining of the string. trailing blanks are removed.
c
c James Blake
c @(#)lenstr.f	1.1  4/3/89 
c
      length = len(string)
      do 10 i = length, 1, -1
         if (string(i:i).ne.' ') go to 20
   10 continue
   20 lenstr = i
      return
      end
