I want to initialize a 2D array in which each member of inner array holds a string of 1000 x's. Something like:
var data = [num_rows][num_cols]string("x....x(upto 1000)")
But all google searches have been futile. In C++ I can achieve similar thing like this:
vector<vector<string>> data(num_rows, vector<string>(num_cols, string("x",1000)));
And in Ruby something like this:
Array.new(num_rows) { Array.new(num_cols) { "x"*1000 } }
Want to achieve similar result in go but I am unable to find any documentation to fill a string and initialize a 2D array. Also note that I want to generate the string for each member of array rather than using an available string.
PS : I am also looking for something similar in Rust