Sha256: 7273e584f24432359e7767d7125552c19dccccaa846b20a164a782e9b2cbaf26
Contents?: true
Size: 546 Bytes
Versions: 307
Compression:
Stored size: 546 Bytes
Contents
function transpose_strings(input::AbstractArray) cols = length(input) cols == 0 && return [] rows = maximum(map(x->length(x), input)) result = fill("", rows) for i = 1:rows for j = 1:cols sym = "" if i <= length(input[j]) delta = j-length(result[i])-1 if delta > 0 sym = " " ^ delta end sym = sym * string(input[j][i]) end result[i] = result[i] * sym end end result end
Version data entries
307 entries across 307 versions & 1 rubygems