! copyright (c) 2008 Swedish Defence Research Agency (FOI)
! may not be copied or distributed without written permission from FOI



C	subroutine transfer the blank characters in a character string 
C	to its end



	SUBROUTINE BLANKTOEND (TEXT)
	CHARACTER*(*) TEXT !  input/output:  the character string

	CHARACTER*1 CH

	J=0
	DO I=1,LEN(TEXT)
	  CH=TEXT(I:I)
	  IF (CH.NE.' ') THEN
	    J=J+1
	    IF (J.LT.I) TEXT(J:J)=CH
	  END IF
	END DO
	DO I=J+1,LEN(TEXT)
	  TEXT(I:I)=' '
	END DO

	RETURN
	END
