Details
Description
Native generic in array reestruturation
- normal array = typed collection with static size
string[] arr = new string[10];
- array as generic, typed collection with dynamic size
string[] arr= new string[*];
- operation with arrays
arr += "nome"; // = list.add("nome");
arr1 += arr2; // [1,2] + [3,4] = [1,2,3,4];
arr -= "nome2"; // = list.removeInSearchContent("nome2");
arr = arr * "nome"; // set all itens = "nome";
arr = arr / "nome"; // remove all items = "nome";
arr[1] = null; // way to remove item without resize;
arr[1].dispose(); // remove item and resize;
- comparisson with arrays
arr1 > arr2 or arr1< arr2; // compare length
arr1== arr2; // compare equality with each ite, content
- to simulate dynamic type like generic:
def[] arr = new def[*]
obs.: the index first must 1 based like in SQL(is more intuitive)