A = Matrix.New({{1,2},{3,4}}) AStr = tostring(A) print(AStr) BStr = string.gsub(AStr, "{", "[") BStr = string.gsub(BStr, "}", "]") print(BStr)