{{indexmenu_n>999}} ====== Tostring ====== ### We can turn matrix objects to strings. This allows one to print matrices. One can however also change the format of the string before printing a matrix ### ===== Example ===== ### Here we change the curly brackets {,} to straight brackets [,]. ### ==== Input ==== A = Matrix.New({{1,2},{3,4}}) AStr = tostring(A) print(AStr) BStr = string.gsub(AStr, "{", "[") BStr = string.gsub(BStr, "}", "]") print(BStr) ==== Result ==== { { 1 , 2 } , { 3 , 4 } } [ [ 1 , 2 ] , [ 3 , 4 ] ] ===== Table of contents ===== {{indexmenu>..:#2|tsort}}