FortranStrings.FortranString
— TypeFortranString{CharType}
Datatype for emulating FORTRAN CHARACTER*N
strings.
This type is a wrapper for a Vector
with elements of type CharType
. Some functions and broadcasting added for limited strings emulation.
Assignment should be done via broadcasting:
julia> s = F8"abc"; s .= "AB" * F"CD"; s
F8"ABC"
julia> s = F"abc"; s[2:end] .= "ABC"; s
F"aAB"
Element-wise assignment is also supported, but it is not FORTRAN alike. Element comparison
julia> s = F8"abc"; s[1:1] == 'a'
true
julia> s = F8"abc"; (s[1:1] == 'a', s[2:2] == "b")
(true, true)
See also @F_str
for quoting.
FortranStrings.INDEX
— MethodINDEX(STRING, SUBSTRING, BACK=false)
Return the position of the start of the first occurrence of string SUBSTRING
as a substring in STRING
, counting from one.
If SUBSTRING
is not present in STRING
, zero is returned. If the BACK
argument is present and true, the return value is the start of the last occurrence rather than the first.
FortranStrings.LEN
— MethodLEN(STRING)
FORTRAN compatible name alias for length()
.
FortranStrings.LEN_TRIM
— MethodLEN_TRIM(STRING)
Return the length of the STRING
with trailing spaces ignored.
FortranStrings.LNBLNK
— MethodLNBLNK(STRING)
Alias for LEN_TRIM.
FortranStrings.LSAME
— MethodLSAME(s1, s2)
Standard BLAS function to compare first character of two strings, returns bool
.
FortranStrings.REPEAT
— MethodREPEAT(STRING, N)
Repeat STRING
N
times.
FortranStrings.SCAN
— MethodSCAN(STRING, CHARSET, BACK=false)
Return the position of the start of the first occurrence of string CHARSET
as a CHARSET
in STRING
, counting from one.
If CHARSET
is not present in STRING
, zero is returned. If the BACK
argument is present and true, the return value is the start of the last occurrence rather than the first.
FortranStrings.TRIM
— MethodTRIM(STRING)
Return a truncated copy of the STRING
where all trailing spaces are removed.
FortranStrings.@F8_str
— MacroF8"some string"
String macro for compatible with FORTRAN strings FortranString{UInt8}
.
The 'd'
and "qq"
flag can be used to emulate behaviour fortran strings in double quotes, where the double quotes inside such strings must be doubled:
F8"Use \"\"doubled\"\""qq
The 'q'
flag indicates the emulation of Fortran strings in single quotes:
F8"Can''t be with only single quote inside"q
FortranStrings.@F_str
— MacroF"some string"
String macro for FortranString{Char}("some string")
.
The 'd'
and "qq"
flag can be used to emulate behaviour fortran strings in double quotes, where the double quotes inside such strings must be doubled:
F8"Use \"\"doubled\"\""qq
The 'q'
flag indicates the emulation of Fortran strings in single quotes:
F8"Can''t be with only single quote inside"q