Skip to content

Commit

Permalink
avoid invalid string index with prevind, findlast
Browse files Browse the repository at this point in the history
  • Loading branch information
milankl committed Sep 13, 2023
1 parent 5fa817d commit 3ad6cdb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utility_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function print_fields(io::IO,A,keys;arrays::Bool=false)
s *= "$key, "
end
end
print(io,s[1:end-2]) # remove last ", "

# remove last ", "
s_without_comma = s[1:prevind(s,findlast(==(','), s))]
print(io,s_without_comma)
end
end

0 comments on commit 3ad6cdb

Please sign in to comment.