Yes, use SparseArrays.dropzeros!
.
For best performance you likely want to use some reordering of the dofs, e.g. Cuthill Mckee.
If you are solving something with the same sparsity pattern multiple times, it is generally better to only create the sparsity pattern once, and then assemble directly into the CSC structure in each “time step” (e.g. as in http://kristofferc.github.io/JuAFEM.jl/dev/examples/generated/heat_equation/#Degrees-of-freedom-1).