|
◆ word_split()
integer function, public char_utilities::word_split |
( |
character(len=*), intent(in) |
input_string, |
|
|
integer, dimension(:), optional, pointer |
word_start, |
|
|
integer, dimension(:), optional, pointer |
word_end, |
|
|
character(len=1), optional |
sep |
|
) |
| |
Split a line into words at a predefined character (default blank).
Returns the number of words in input_string. If pointers word_start and word_end are provided, they are allocated with nword elements and set to the indices of initial and final character of every word in input_string. Groups of contiguous separation characters are treated as a single separator character.
- Parametri
-
[in] | input_string | string to be scanned |
| word_start | indices of first character of each word in input_string, allocated here, must be deallocated by the user |
| word_end | indices of last character of each word in input_string, allocated here, must be deallocated by the user |
| sep | optional word separator character, if not provided, a blank space is assumed |
Definizione alla linea 942 del file char_utilities.F90.
942 100 cols = defaultcols 944 END FUNCTION default_columns 948 FUNCTION suffixname ( Input_String ) RESULT ( Output_String ) 950 CHARACTER( * ), INTENT( IN ) :: Input_String 951 CHARACTER( LEN( Input_String ) ) :: Output_String 956 i = index(input_string, ".",back=.true.) 957 if (i > 0 .and. i < len(input_string)) output_string= input_string(i+1:) 959 END FUNCTION suffixname 968 elemental_unlessxlf FUNCTION wash_char(in, goodchar, badchar) RESULT(char) 969 CHARACTER(len=*), INTENT(in) :: in 970 CHARACTER(len=*), INTENT(in), OPTIONAL :: badchar 971 CHARACTER(len=*), INTENT(in), OPTIONAL :: goodchar 972 integer, allocatable :: igoodchar(:) 973 integer, allocatable :: ibadchar(:) 975 CHARACTER(len=len(in)) :: char,charr,charrr 976 INTEGER :: i,ia,nchar 982 if ( present(goodchar)) then 984 allocate(igoodchar(len(goodchar))) 986 do i =1, len(goodchar) 987 igoodchar=ichar(goodchar(i:i)) 993 if (any(ia == igoodchar)) then 995 charrr(nchar:nchar)=achar(ia) 999 deallocate(igoodchar)
|