Statistics
| Revision:

root / src / NoString.f90 @ 10

History | View | Annotate | Download (638 Bytes)

1
      SUBROUTINE noString(String)
2

    
3
! This subroutine suppress the content of string variable
4
! strings can be delimited by ' or "
5
! example:
6
! Progexe='./siesta', -> Progexe=,
7

    
8
        use VarTypes
9

    
10
        IMPLICIT NONE
11

    
12
        CHARACTER(*), INTENT(INOUT) :: String
13
        CHARACTER(VLCHARS) :: Result
14
        INTEGER(KINT) :: i
15
        CHARACTER(2), PARAMETER :: Del='"' // "'"
16

    
17
        DO WHILE (scan(String,Del)/=0)
18
           I=Scan(String,Del)
19
           Result=String(:I-1)
20
           String=String(I+1:)
21
           I=Scan(String,Del)
22
           String=TRIM(Result) // String(I+1:)
23
        END DO
24

    
25
      END SUBROUTINE NoString
26