Index of the last byte before the line break at or after i.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
source text |
||
| integer, | intent(in) | :: | i |
byte to start from |
pure integer function line_end(src, i) result(j) !! Index of the last byte before the line break at or after `i`. character(len=*), intent(in) :: src !! source text integer, intent(in) :: i !! byte to start from j = i do while (j <= len(src)) if (src(j:j) == LF .or. src(j:j) == CR) exit j = j + 1 end do j = j - 1 end function line_end