I am working to make a database from scratch.
I have a jagged called data
array, I try to clone(lns
) it, the clone(lns
) becomes lower case and so data
becomes too. But I do not want that! How can I prevent this? ignorecase
is true. If I set that to false, the problem no longer occurs.
You may do not believe it, at least I don't, so I uploaded a video.
public string[][] getRows(string[][] data, int columnLength, int index = -1, string arg = "", bool ignoreCase = false, bool getContaining = false)
{
if (index >= columnLength) return null; // I love null!
if (!getContaining && arg == "") return data;
string[][] toReturn = new string[data.Length][];
string[][] lns = data;
int a = 0;
if (ignoreCase)
{
arg = arg.ToLower();
for (int i = 0; i < columnLength; i++)
for (int j = 0; j < lns.Length; j++)
lns[j][i] = lns[j][i].ToLower();
}
if (index >= 0)
{
if (getContaining)
{
for (int i = 0; i < data.Length; i++)
if (lns[i][index].Contains(arg))
{
toReturn[a] = data[i];
// code continues...
EDIT: Okay, I do know now that lns = data
doesn't make a clone, but just makes another variable. But how can I clone this so I can execute this code?